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

Online transactions are used when the goods are delivered using registered mail.

Operations

Clients

Clients represent partner applications.

Operations

Users

Users represent users of the platform.

Operations

Personal

Personal endpoints are used for managing personal details for users, for "Know Your Customer" requirements.

Operations

Notifications

Notifications log updates for users.

Operations

F2F Transactions

F2F2 transactions are used when the goods are delivered in person.

Operations

Online Multi-use Listings

These endpoints are no longer supported. We do not recommend using these endpoints.

Operations

Online Single-use Listings

These endpoints are no longer supported. We do not recommend using these endpoints.

Operations

F2F Multi-use Listings

These endpoints are no longer supported. We do not recommend using these endpoints.

Operations

Create a new multi-use, face-to-face listing for the logged-in user Deprecated

Request

Multi-use listings can be used to create transactions. Offline access is allowed for this endpoint when the user has granted the p2p_ls:offline_create scope to the client that is performing the request.

Bodyapplication/jsonrequired
charge_calculator_versioninteger(int64)required

The charge_calculator_version value returned from a request to /p2p/charge.

Example: 5
charge_sellerinteger(int64)

The charge_seller value returned from a request to /p2p/charge.

currencystring(Currency)required
Enum"aud""eur""gbp""myr""pln""sek""usd""huf"
Example: "eur"
deposit_chargeinteger(int64)required

The charge value returned from a request to /p2p/charge.

Example: 78
deposit_priceinteger(int64)required

The price of the goods being sold, in the currency's smallest unit. The charge value should correspond to the Trustap charge created with this price, otherwise this request will fail with a 400 error.

Example: 1234
descriptionstringrequired

A description of the goods being sold.

Example: "Soccer ticket"
rolestring(basic.Role)required
Enum"buyer""seller"
Example: "buyer"
skip_remainderboolean

If skip_remainder is true then the transaction will move to the "confirm handover" step after the deposit has been accepted.

curl -i -X POST \
  https://dev.stage.trustap.com/api/v1/p2p/me/multi_use_listings/create \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "charge_calculator_version": 5,
    "currency": "eur",
    "deposit_charge": 78,
    "deposit_price": 1234,
    "description": "Soccer ticket",
    "role": "seller"
  }'

Responses

Created

Bodyapplication/json
allows_multi_useboolean
Example: true
createdstring
Example: "2019-12-25T09:00:00Z"
creator_idstring
Example: "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7"
creator_rolestring
currencystring
deposit_pricingobject(basic.Pricing)
Example: {"charge":78,"price":1234}
descriptionstring
idinteger(int64)required
Example: "77f36253-7a43-4d47-897d-f73dd208e17a"
skip_remainderboolean
Response
application/json
{ "allows_multi_use": true, "created": "2019-12-25T09:00:00Z", "creator_id": "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7", "deposit_pricing": { "charge": 150, "price": 5000 }, "description": "", "id": "77f36253-7a43-4d47-897d-f73dd208e17a", "skip_remainder": false }

Delete this listingDeprecated

Request

Path
listingIdinteger(int64)required
curl -i -X DELETE \
  'https://dev.stage.trustap.com/api/v1/p2p/multi_use_listings/{listingId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Get a listing by its IDDeprecated

Request

Path
listingIdinteger(int64)required
curl -i -X GET \
  'https://dev.stage.trustap.com/api/v1/p2p/multi_use_listings/{listingId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
allows_multi_useboolean
Example: true
createdstring
Example: "2019-12-25T09:00:00Z"
creator_idstring
Example: "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7"
creator_rolestring
currencystring
deposit_pricingobject(basic.Pricing)
Example: {"charge":78,"price":1234}
descriptionstring
idinteger(int64)required
Example: "77f36253-7a43-4d47-897d-f73dd208e17a"
skip_remainderboolean
Response
application/json
{ "allows_multi_use": true, "created": "2019-12-25T09:00:00Z", "creator_id": "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7", "deposit_pricing": { "charge": 150, "price": 5000 }, "description": "", "id": "77f36253-7a43-4d47-897d-f73dd208e17a", "skip_remainder": false }

F2F Single-use Listings

These endpoints are no longer supported. We do not recommend using these endpoints.

Operations