Tilia iOS SDK

The Tilia iOS SDK makes it easy to add payments natively within mobile apps.

Use Cases

The iOS SDK v1.0 supports token-only invoices in both standard and escrow transaction flows. Refer to Escrow transactions to learn more about if escrow transactions are the right fit for your business.

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 reccommend 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

Using CocoaPods, add the following to your Podfile:

Copy
Copied
pod 'TiliaSDK'

More information on setup can be found on Github.

Configuration

Flows

Helper Methods

Demo Application

Our iOS Demo Application is an easy way to see how the Tilia SDK works. See more here