Tilia Unity SDK

The Tilia Unity SDK makes it easy to add payments natively within Unity applications.

Prerequisites

Tilia SDKs are meant to be used in concert with your own api server which will communicate with Tilia APIs to retrieve things such as temporary access tokens for your authenticated users and any other data the Tilia SDK may need.

To test integrating with the Tilia SDK, instead of setting up your own server you can use a rest client to simulate the calls that your server will make to Tilia APIs (we recommend Postman).

In order to get started testing your integration with Tilia you will need access to our staging environment. To request access, please contact our Sales Team. Once set up on staging, you will receive this information:

  • Your client ID and client secret (these will be used by your server to communicate with our Tilia APIs. It's important to keep these credentials secure and to always ensure you are properly authenticating your end users).
  • A test token ('TOK', unless otherwise specified).
  • A registered user account_id for testing payments. This initial test user will have a USD and token wallet preloaded with enough funds to run tests. Refer to Registering Users for information on creating user accounts.

Creating a 'Client Credentials' Access Token

The first step of any interaction with the Tilia APIs is to create a 'Client Credentials' access token. With this token you can interact with the requisite Tilia API endpoints to gather the information required by the Tilia SDK. Required token scopes: read_invoice, write_invoice, write_payment_method, read_payment_method, write_invoices and write_user_tokens.

Copy
Copied
curl --location --request POST 'https://auth.staging.tilia-inc.com/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<YOUR_CLIEND_ID>' \
--data-urlencode 'client_secret=<YOUR_CLIEND_SECRET>' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=read_invoice,write_invoice,write_payment_method,read_payment_method,write_invoices,write_user_tokens'

Add the SDK to your Project

Download the Tilia SDK from the Unity Asset store here

attention

You can customize the UI to your liking, but it must meet certain legal criteria before it can be used in a production environment.

Flows

Test the SDK Flows

Once you download the Tilia asset from the Unity Asset store, add the Tilia scene to your Unity project. You can now begin testing the flows using the Demo Scene to see how the Tilia SDK works.