Tutorial: Transactions overview

The tutorials in this section demonstrate different transaction models that Tilia services support.

Usage note

You must run all of the User account tutorials at least one time before you run the tutorials in this section. The tutorials in this section use the environment variables that the User account tutorials initialize.

If a request requires data that has not yet been configured, it displays an error message in the Postman console log.

Choose a transaction model

The following table lists the transaction models demonstrated in these tutorials. Note that you must have a valid access token to run the exercises in a tutorial.

Transaction model Currency used Users involved Description
Standard user-to-user TIL tokens payer
recipient
A standard user-to-user transaction
Standard user-to-user with royalties TIL tokens payer
recipient
creator
A user-to-user transaction that pays the creator a portion of the transaction
User-to-user with escrow TIL tokens payer
recipient
A standard user-to-user transaction that holds the funds in escrow
User-to-publisher and user-to-user using Checkout UI USD fiat currency payer
publisher
recipient
A user's purchases from the publisher and another user using the Tilia-hosted checkout widget
NFT purchase from publisher USD fiat currency payer
publisher
The recipient requests a payout of convertible tokens to fiat currency
Payout to user TIL tokents
USD fiat currency
recipient A purchase from the publisher using the payer's payment method and holding the funds in escrow

In addition to the transaction examples, this tutorial presents several methods for getting information about transactions in Transaction info

Get an access token

Get an access token for the tutorials in this section.

Each request requires an authentication header with a valid access token that has the necessary scope for the request.

This request obtains an access token with the scopes required for all the tutorials in this section. After you've requested the access token for the collection, Postman adds the required authentication header to the subsequent requests in the collection.

For more information about access tokens, visit Request access token.

To get your access token for the transaction tutorials, in Postman:

  1. Near the top right of the request, above the request URL, choose the Tilia Client Info environment.
  2. In the Explore Tilia transactions collection, in the Start here folder, open the Get an access token request, and then choose the Body tab.
  3. In the Body tab, notice that the client_id and client_secret properties use the environment variables that you assigned in Get started with the tutorials .
  4. Choose Send (to the right of the request's URL field) to request the access token.
  5. If the request was successful:
    1. The access_token value is saved in the last_tilia_access_token collection variable.
    2. Review the response body.
    3. Review the Collection variables to confirm that the Current value of last_tilia_access_token also has the token value.
  6. If the request returns an error, review the response body for more information about the problem. Also, check that the correct environment is selected and that there are no errors in your Tilia developer credential values.

A typical response body is shown in Get an access token (User accounts).

With that, you're ready to try the rest of the requests in the collection.

Your access token is only good for an hour

In the response body of the Get an access token request, notice the value of the expires_in property. That value is the duration, in seconds, that the token is valid. In this case, the token is valid for 3,600 seconds, which is one hour. After using the access token for more than an hour, your requests return a response body like the following.

Copy
Copied
{    
    "status": "Failure", 
    "message": [],
    "codes": [],
    "payload": { 
        "error": "token is expired"
    }
}

If you get this response body later, return to this collection's Start here folder, open the Get access token request, and then send it again to get a new token for the collection.

Next steps

Choose a Tilia transaction to explore from the preceding table, or start with the Standard user-to-user transaction.