Trustap API (0.1.0)

The Trustap API is a REST-based API for managing user data and transactions for Trustap users.

Note that, like Stripe, all API price and charge fields expect amounts to be provided in a currency's smallest unit. See the Stripe documentation for more details.

API Keys


Some endpoints such as /charge endpoints can be accessed directly using an API key. API keys are provided as the "username" portion of a basic auth authentication. For example, the Trustap fee for a new online transaction can be determined using the following cURL request with an API key:

curl -u '<api_key>': 'https://dev.stage.trustap.com/api/v1/charge?currency=eur&price=1234'

Deprecation


Deprecated endpoints are tagged with the word DEPRECATED at the start of their description. The deprecation message will describe what endpoints/approach should be used instead.

Note that deprecated endpoints will not be removed from the current version of the API, but their use is discouraged. Furthermore, migrating to later major versions of the API will be made easier by avoiding deprecated endpoints.

Production


This documentation references the staging environment of the Trustap API, which is available at https://dev.stage.trustap.com and uses the trustap-stage realm during authentication. This environment can be used for implementing and testing features using test credit cards, bank accounts, etc.

When all features using Trustap have been implemented and tested sufficiently, the production environment of the Trustap API can be used to process actual currency. This environment is available at https://dev.trustap.com and uses the trustap realm during authentication.

Note that only your client ID will be the same in the staging and production Trustap API environments; your client secret and API key will be different in the two environments.

Download OpenAPI description
Overview
Languages
Servers
https://dev.stage.trustap.com/api/v1/

Online Transactions

Operations

Clients

Operations

Users

Operations

Create a new guest user

Request

This endpoint creates guest user which can be used as the buyer or the seller. If guest user is used as the seller in a transaction, they need to be created with country_code parameter correctly set. This is important because of currencies they can use in their transactions. tos_acceptance is the parameter which is important for disputes/chargeback and represent the timestamp when Trustap ToS were accepted https://www.trustap.com/terms.

Bodyapplication/jsonrequired
country_codestring
Example: "IE"
emailstringnon-emptyrequired
Example: "guest@test.com"
first_namestringnon-emptyrequired
Example: "Test"
last_namestringnon-emptyrequired
Example: "User"
tos_acceptanceobject(users.TosAcceptance)required
tos_acceptance.​ipstringnon-emptyrequired
tos_acceptance.​unix_timestampinteger(int64)required
curl -i -X POST \
  https://dev.stage.trustap.com/api/v1/guest_users \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "country_code": "IE",
    "email": "guest@test.com",
    "first_name": "Test",
    "last_name": "User",
    "tos_acceptance": {
      "ip": "192.168.1.2",
      "unix_timestamp": 1672531200
    }
  }'

Responses

Created

Bodyapplication/json
created_atstring(date-time)required
deleted_atstring(date-time)
emailstringrequired
idstringrequired
Example: "1-feb33a87-3917-4538-9260-127c8a6b5232"
Response
application/json
{ "id": "1-feb33a87-3917-4538-9260-127c8a6b5232" }

Get the balance for the current user in each currency

Request

curl -i -X GET \
  https://dev.stage.trustap.com/api/v1/me/balances \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
availableArray of objectsrequired
available[].​amountinteger(int64)required
available[].​currencystringrequired
Response
application/json
{ "available": [ {} ] }

Get the status enabled/disabled of user's features.

Request

curl -i -X GET \
  https://dev.stage.trustap.com/api/v1/me/features \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
instant_payouts_enabledboolean
Response
application/json
{ "instant_payouts_enabled": true }

Allows users to turn instant payouts feature on/off.

Request

Bodyapplication/jsonrequired
enabledbooleanrequired
curl -i -X POST \
  https://dev.stage.trustap.com/api/v1/me/features/instant_payouts \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "enabled": true
  }'

Responses

OK

Bodyapplication/json
instant_payouts_enabledboolean
Response
application/json
{ "instant_payouts_enabled": true }

Retrieve a user by email address

Request

Query
emailstringrequired
curl -i -X GET \
  'https://dev.stage.trustap.com/api/v1/users?email=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
created_atstring(date-time)required
deleted_atstring(date-time)
emailstringrequired
idstringrequired
Example: "2-feb33a87-3917-4538-9260-127c8a6b5232"
Response
application/json
{ "id": "2-feb33a87-3917-4538-9260-127c8a6b5232" }

Create a new user

Request

This endpoint creates a new user account which can be used as the buyer or the seller in a transaction.

Bodyapplication/jsonrequired
country_codestring>= 2 characters
emailstringnon-emptyrequired
tos_acceptanceobject(users.TosAcceptance)
curl -i -X POST \
  https://dev.stage.trustap.com/api/v1/users \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "country_code": "string",
    "email": "string",
    "tos_acceptance": {
      "ip": "string",
      "unix_timestamp": 0
    }
  }'

Responses

Created

Bodyapplication/json
created_atstring(date-time)required
deleted_atstring(date-time)
emailstringrequired
idstringrequired
Example: "2-feb33a87-3917-4538-9260-127c8a6b5232"
Response
application/json
{ "id": "2-feb33a87-3917-4538-9260-127c8a6b5232" }

Personal

Operations

Online Multi-use Listings

Operations

Notifications

Operations

Online Single-use Listings

Operations

F2F Transactions

Operations

F2F Multi-use Listings

Operations

F2F Single-use Listings

Operations

Subscriptions

Operations