Skip to content
Last updated

In Trustap, users are the entities that buy and sell products or services. Every Trustap transaction requires two users: a buyer and a seller. Trustap supports two types of users, Guest Users and Full Users.

Setting up user accounts can take time and create friction for users interacting with your product. To mitigate this, we use Guest Accounts to defer the registration process.

  • Buyers can remain guest users for the entire duration of the transaction.
  • Sellers can remain guest users for most of the transaction process but must register as full users to receive their payout.

Use cases

eCommerce

For applications where the seller does not change (e.g., a standard eCommerce store), we recommend using a single Full User account for the merchant.

Single Seller to Multiple Buyers

  • Create one Full User and retain that ID for the seller.
  • Create Guest Users for each buyer.

Marketplaces

For applications with multiple sellers and multiple buyers (for example, peer-to-peer platforms).

Multiple Sellers to Multiple Buyers

  • Create Guest Users for both sellers and buyers initially to reduce friction.
  • Convert the seller to a Full User when they need to be paid out.

Create users

Create guest users

Use the guest users endpoint to create a new guest user.

Create guest users
curl --location 'https://dev.stage.trustap.com/api/v1/guest_users' \
--header 'Content-Type: application/json' \
--user '<API_KEY>:' \
--data-raw '{"email":"sarah.garcia@shopit.com","first_name":"Sarah","last_name":"Garcia","country_code":"ie","tos_acceptance":{"unix_timestamp":1737558834,"ip":"127.0.0.1"}}'

Response

{
    "created_at": "2025-01-24T15:43:20.310247061Z",
    "email": "sara.garcia@shopit.com",
    "id": "1-886e3c26-b585-4c92-a93b-e3c84b9b32e9"
}

Create full users

You can identify full users from guest users by looking at their id. A guest user id will always begin with 1-. For example 1-615a70d4-b624-4243-95be-a8367b7953ea.

Use the following guides to create full users.

Apply users in a transaction

Once users are created, use the returned id as the seller_id and buyer_id when creating a transaction.

Create transaction with user IDs

curl --location 'https://dev.stage.trustap.com/api/v1/me/transactions/create_with_guest_user' \
--header 'Trustap-User: 1-886e3c26-b585-4c92-a93b-e3c84b9b32e9' \
--header 'Content-Type: application/json' \
--user '<API_KEY>:' \
--data '{
    "seller_id": "1-886e3c26-b585-4c92-a93b-e3c84b9b32e9",
    "buyer_id": "1-615a70d4-b624-4243-95be-a8367b7953ea",
    "creator_role": "seller",
    "currency": "gbp",
    "description": "Ireland vs Croatia UEFA Nations League",
    "price": 20000,
    "charge": 760,
    "charge_calculator_version": 5,
    "image_url": "https://docs.trustap.com/images/soccer-tickets.png"
}'