Trustap API API Reference

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.

Note that Trustap only supports usd as currency at present.

API Endpoint
https://dev.trustap.com/api/v1
Contact: help@trustap.com
Schemes: https
Version: 0.1.0

Authentication

OAuth2

flow
accessCode
authorizationUrl
https://dev.trustap.com/api/v1/oauth2/authorize
tokenUrl
https://dev.trustap.com/api/v1/oauth2/token

Paths

Get transactions for the logged-in user

GET /me/transactions

Transactions are currently sorted by ID.

after_id

Only return transactions that were created chronologically after the transaction with this ID (i.e. with smaller IDs)

type
integer (int64) , { x ∈ ℤ | x ≥ 0 }
in
query
limit

The maximum number of transactions to return

type
integer (int64) , { x ∈ ℤ | 1 ≤ x ≤ 50 } 25
in
query

OK

Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "integer (int64)",
    "currency": "string",
    "price": "integer (int64)",
    "charge": "integer (int64)",
    "descr": "string",
    "created": "string",
    "buyer_id": "integer (int64)",
    "seller_id": "integer (int64)",
    "joined": "string",
    "paid": "string",
    "tracked": "string",
    "delivered": "string",
    "complained": "string",
    "complaint": "string",
    "funds_released": "string",
    "join_code": "string"
  }
]

Create a new Trustap transaction

POST /me/transactions

A request to this endpoint must be preceded by a call to /charge with the price of the goods specified in price. The charge returned from charge MUST be shown to the user to accept, and included in the final cost displayed for the transaction.

role: Role
currency: Currency
price: integer (int64)

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.

description: string

A description of the goods being sold.

charge: integer (int64)

The charge value returned from a request to /charge.

charge_calculator_version: integer (int64)

The charge_calculator_version value returned from a request to /charge.

Request Content-Types: application/json
Request Example
{
  "role": "string",
  "currency": "string",
  "price": "integer (int64)",
  "description": "string",
  "charge": "integer (int64)",
  "charge_calculator_version": "integer (int64)"
}
201 Created

Created

400 Bad Request

Bad request

Response Content-Types: application/json
Response Example (201 Created)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Get personal information for the logged-in user

GET /me/personal
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "name": {
    "first": "string",
    "last": "string"
  },
  "address": {
    "city": "string",
    "line1": "string",
    "line2": "string",
    "state": "string",
    "postal_code": "string",
    "country_code": "string"
  },
  "dob": {
    "day": "integer (int64)",
    "month": "integer (int64)",
    "year": "integer (int64)"
  },
  "tos_acceptance": {
    "unix_timestamp": "integer (int64)",
    "ip": "string",
    "user_agent": "string"
  }
}

Update personal information for the logged-in user

PUT /me/personal
name: Name
address: Address
dob: Dob
Request Content-Types: application/json
Request Example
{
  "name": {
    "first": "string",
    "last": "string"
  },
  "address": {
    "city": "string",
    "line1": "string",
    "line2": "string",
    "state": "string",
    "postal_code": "string",
    "country_code": "string"
  },
  "dob": {
    "day": "integer (int64)",
    "month": "integer (int64)",
    "year": "integer (int64)"
  }
}
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "name": {
    "first": "string",
    "last": "string"
  },
  "address": {
    "city": "string",
    "line1": "string",
    "line2": "string",
    "state": "string",
    "postal_code": "string",
    "country_code": "string"
  },
  "dob": {
    "day": "integer (int64)",
    "month": "integer (int64)",
    "year": "integer (int64)"
  },
  "tos_acceptance": {
    "unix_timestamp": "integer (int64)",
    "ip": "string",
    "user_agent": "string"
  }
}

Confirm that the logged-in user accepted the Trustap Terms of Service and the Stripe Connected Account Agreement

POST /me/accept_tos

Note that the client making this request must have presented the logged-in user with the Trustap Terms of Service and the Stripe Connected Account Agreement, and this user must have expressly consented to the agreement, prior to making this request. See https://stripe.com/docs/connect/updating-accounts#tos-acceptance for more details.

undefined
Request Content-Types: application/json
Request Example
{
  "unix_timestamp": "integer (int64)",
  "ip": "string",
  "user_agent": "string"
}
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "name": {
    "first": "string",
    "last": "string"
  },
  "address": {
    "city": "string",
    "line1": "string",
    "line2": "string",
    "state": "string",
    "postal_code": "string",
    "country_code": "string"
  },
  "dob": {
    "day": "integer (int64)",
    "month": "integer (int64)",
    "year": "integer (int64)"
  },
  "tos_acceptance": {
    "unix_timestamp": "integer (int64)",
    "ip": "string",
    "user_agent": "string"
  }
}

Add a credit account for the logged-in user

POST /me/credit_account
type: CreditAccountType
bank_details: BankDetails
card_details: CardDetails
Request Content-Types: application/json
Request Example
{
  "type": "string",
  "bank_details": {
    "account_number": "string",
    "country_code": "string",
    "currency": "string",
    "routing_number": "string"
  },
  "card_details": "string"
}
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "bank_account": {
    "country": "string",
    "currency_alpha_2": "string",
    "last4": "string",
    "bank_name": "string",
    "routing": "string"
  },
  "card": {
    "last4": "string",
    "month": "integer (uint8)",
    "year": "integer (uint16)"
  }
}

Get the Trustap fee for a transaction

GET /charge

This returns the Trustap fee, in the currency's smallest unit, for a transaction involving goods with the supplied price. See the Stripe documentation for more details.

currency

The currency that the price is specified in.

type
string
in
query
price

The price of the goods being sold in this transaction, in the currency's smallest unit. For example, if a trading card is being sold for $12.34 (with currency as usd), then the request for the charge for this transaction would be /charge?price=1234&currency=usd.

type
integer (int64)
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "currency": "string",
  "charge": "integer (int64)",
  "charge_calculator_version": "integer (int64)"
}

Get a transaction using a join code

GET /transactions
join_code

(no description)

type
string
in
query

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Join a transaction using a join code

PUT /transactions

A transaction can't be joined using its ID, because only the buyer and seller of a transaction can access a transaction using its ID.

join_code

(no description)

type
string
in
query

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Reject a transaction by its join code

POST /transactions-by-join-code/{joinCode}/reject

A transaction can't be rejected using its ID, because only the buyer and seller of a transaction can access a transaction using its ID.

joinCode

(no description)

type
string
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Get a transaction by its ID

GET /transactions/{transactionId}
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Set payment details and process payment for this transaction

POST /transactions/{transactionId}/pay
stripe_token: string

stripe_token is a card token ID received from Stripe. It is generated using a publishable Stripe key from Trustap. See https://stripe.com/docs/stripe-js and https://stripe.com/docs/checkout for methods for generating this token.

transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "stripe_token": "string"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Set postal tracking details for this transaction

POST /transactions/{transactionId}/track
carrier: Carrier
tracking_code: string
transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "carrier": "string",
  "tracking_code": "string"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Submit a complaint for this transaction

POST /transactions/{transactionId}/complain
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Submit a complaint for this transaction with description

POST /transactions/{transactionId}/complain_with_description
complaint_description: string
transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "complaint_description": "string"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

End the complaint period for this transaction

POST /transactions/{transactionId}/end_complaint_period
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Create a new listing for the logged-in user.

POST /me/single_use_listings
200 OK

Created

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Get this listing ID

GET /single_use_listings/{listingId}
listingId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Delete this listing ID

DELETE /single_use_listings/{listingId}
listingId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json

Set description for this listing

POST /single_use_listings/{listingId}/set_description
listing_description: string
listingId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "listing_description": "string"
}
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Set pricing for this listing

POST /single_use_listings/{listingId}/set_pricing
currency: Currency
price: integer (int64)

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.

charge: integer (int64)

The charge value returned from a request to /charge.

charge_calculator_version: integer (int64)

The charge_calculator_version value returned from a request to /charge.

listingId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "charge_calculator_version": "integer (int64)"
}
200 OK

OK

400 Bad Request

Bad request

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Create transaction for this listing

POST /single_use_listings/{listingId}/create_transaction
listingId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

Set active country for user

POST /me/personal/set_active_country
country_code: string
Request Content-Types: application/json
Request Example
{
  "country_code": "string"
}
200 OK

OK

Response Content-Types: application/json

Get notifications for the logged-in user

GET /me/notifications
after_id

Only return notifications that were created chronologically after the notification with this ID (i.e. with smaller IDs)

type
integer (int64) , { x ∈ ℤ | x ≥ 0 }
in
query
limit

The maximum number of notifications to return

type
integer (int64) , { x ∈ ℤ | 1 ≤ x ≤ 50 } 25
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "integer (int64)",
    "created": "string",
    "read": "string",
    "user_id": "string",
    "description": "string",
    "target": "string"
  }
]

Get this notification with Id

GET /notifications/{notificationId}
notificationId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "created": "string",
  "read": "string",
  "user_id": "string",
  "description": "string",
  "target": "string"
}

Mark this notification as read

GET /notifications/{notificationId}/mark_as_read
notificationId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "created": "string",
  "read": "string",
  "user_id": "string",
  "description": "string",
  "target": "string"
}

Get the Trustap fee for a P2P transaction for Face to Face model

GET /p2p/charge

This returns the Trustap fee, in the currency's smallest unit, for a transaction involving goods with the supplied price. See the Stripe documentation for more details.

currency

The currency that the price is specified in.

type
string
in
query
price

The price of the goods being sold in this transaction, in the currency's smallest unit. For example, if a trading card is being sold for $12.34 (with currency as usd), then the request for the charge for this transaction would be /charge?price=1234&currency=usd.

type
integer (int64)
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "currency": "string",
  "charge": "integer (int64)",
  "charge_calculator_version": "integer (int64)"
}

Get P2P transactions for the logged-in user

GET /p2p/me/transactions

Transactions are currently sorted by ID.

after_id

Only return transactions that were created chronologically after the transaction with this ID (i.e. with smaller IDs)

type
integer (int64) , { x ∈ ℤ | x ≥ 0 }
in
query
limit

The maximum number of transactions to return

type
integer (int64) , { x ∈ ℤ | 1 ≤ x ≤ 50 } 25
in
query

OK

Response Content-Types: application/json
Response Example (200 OK)
[
  {
    "id": "integer (int64)",
    "currency": "string",
    "deposit_pricing": {
      "price": "integer (int64)",
      "charge": "integer (int64)"
    },
    "description": "string",
    "created": "string",
    "buyer_id": "integer (int64)",
    "seller_id": "integer (int64)",
    "joined": "string",
    "rejected": "string",
    "cancelled": "string",
    "deposit_paid": "string",
    "deposit_accepted": "string",
    "priced": "string",
    "pricing": {
      "price": "integer (int64)",
      "charge": "integer (int64)"
    },
    "remainder_paid": "string",
    "buyer_handover_confirmed": "string",
    "seller_handover_confirmed": "string",
    "funds_release": "string",
    "complaint": "string",
    "complained": "string"
  }
]

Create a new P2P Trustap transaction

POST /p2p/me/transactions
role: Role
currency: Currency
description: string

A description of the goods being sold.

depositPricing: Pricing
Request Content-Types: application/json
Request Example
{
  "role": "string",
  "currency": "string",
  "description": "string",
  "depositPricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  }
}
201 Created

Created

400 Bad Request

Bad request

Response Content-Types: application/json
Response Example (201 Created)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Get a P2P transaction by its join code

GET /p2p/me/transactions_by_join_code/{joinCode}
joinCode

(no description)

type
string
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Join a P2P transaction by its join code

POST /p2p/transactions_by_join_code/{joinCode}/join
joinCode

(no description)

type
string
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Reject a P2P transaction by its join code

POST /p2p/transactions_by_join_code/{joinCode}/reject
joinCode

(no description)

type
string
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Get a P2P transaction by its ID

GET /p2p/transactions/{transactionId}
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Cancel a P2P transaction by its ID

POST /p2p/transactions/{transactionId}/cancel
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Pay deposit of a P2P transaction by its ID

POST /p2p/transactions/{transactionId}/pay_deposit
stripe_charge_token: string
transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "stripe_charge_token": "string"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Accept deposit for a P2P transaction by its ID

POST /p2p/transactions/{transactionId}/accept_deposit
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Set price of a P2P transaction by its ID

POST /p2p/transactions/{transactionId}/set_price
currency: Currency
price: integer (int64)

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.

charge: integer (int64)

The charge value returned from a request to /charge.

charge_calculator_version: integer (int64)

The charge_calculator_version value returned from a request to /charge.

transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "charge_calculator_version": "integer (int64)"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Pay remainder of a P2P transaction by its ID

POST /p2p/transactions/{transactionId}/pay_remainder
stripe_charge_token: string
transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "stripe_charge_token": "string"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Submit a complaint for this P2P transaction with description

POST /p2p/transactions/{transactionId}/complain
complaint_description: string
transactionId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "complaint_description": "string"
}

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Confirm handover for a P2P transaction by its ID

POST /p2p/transactions/{transactionId}/confirm_handover
transactionId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Create a new P2P listing for the logged-in user.

POST /p2p/me/single_use_listings
200 OK

Created

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Get this P2P listing ID

GET /p2p/single_use_listings/{listingId}
listingId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Delete this P2P listing ID

DELETE /p2p/single_use_listings/{listingId}
listingId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json

Set description for this P2P listing

POST /p2p/single_use_listings/{listingId}/set_description
listing_description: string
listingId

(no description)

type
integer (int64)
in
path
Request Content-Types: application/json
Request Example
{
  "listing_description": "string"
}
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Create transaction for this P2P listing

POST /p2p/single_use_listings/{listingId}/create_transaction
listingId

(no description)

type
integer (int64)
in
path

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}

Get buyer details of this P2P transaction

GET /p2p/transactions/{transactionId}/buyer_details
transactionId

(no description)

type
integer (int64)
in
path
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "email": "string",
  "name": "string"
}

Schema Definitions

Address: object

city: string
line1: string
line2: string
state: string
postal_code: string
country_code: string
Example
{
  "city": "string",
  "line1": "string",
  "line2": "string",
  "state": "string",
  "postal_code": "string",
  "country_code": "string"
}

BankAccount: object

country: string
currency_alpha_2: string
last4: string
bank_name: string
routing: string
Example
{
  "country": "string",
  "currency_alpha_2": "string",
  "last4": "string",
  "bank_name": "string",
  "routing": "string"
}

BankDetails: object

account_number: string
country_code: string
currency: string
routing_number: string
Example
{
  "account_number": "string",
  "country_code": "string",
  "currency": "string",
  "routing_number": "string"
}

Card: object

last4: string
month: integer (uint8)
year: integer (uint16)
Example
{
  "last4": "string",
  "month": "integer (uint8)",
  "year": "integer (uint16)"
}

CardDetails: string

stripe_token is a card token ID received from Stripe. It is generated using a publishable Stripe key from Trustap. See https://stripe.com/docs/stripe-js and https://stripe.com/docs/checkout for methods for generating this token.

Example
"string"

Carrier: string , x ∈ { fedex , ups , usps }

Example
"string"

Charge: object

currency: string
charge: integer (int64)

The Trustap fee, in the currency's smallest unit, for a queried amount. See the Stripe documentation for more details.

charge_calculator_version: integer (int64)

The version of the Trustap charge calculator that was used to calculate this charge.

Example
{
  "currency": "string",
  "charge": "integer (int64)",
  "charge_calculator_version": "integer (int64)"
}

CreditAccount: object

bank_account: BankAccount
card: Card
Example
{
  "bank_account": {
    "country": "string",
    "currency_alpha_2": "string",
    "last4": "string",
    "bank_name": "string",
    "routing": "string"
  },
  "card": {
    "last4": "string",
    "month": "integer (uint8)",
    "year": "integer (uint16)"
  }
}

CreditAccountType: string , x ∈ { bank , card }

Example
"string"

Currency: string , x ∈ { usd }

Example
"string"

Dob: object

day: integer (int64)
month: integer (int64)
year: integer (int64)
Example
{
  "day": "integer (int64)",
  "month": "integer (int64)",
  "year": "integer (int64)"
}

Name: object

first: string
last: string
Example
{
  "first": "string",
  "last": "string"
}

User: object

email: string
name: string
Example
{
  "email": "string",
  "name": "string"
}

PersonalInfo: object

name: Name
address: Address
dob: Dob
tos_acceptance: TosAcceptance
Example
{
  "name": {
    "first": "string",
    "last": "string"
  },
  "address": {
    "city": "string",
    "line1": "string",
    "line2": "string",
    "state": "string",
    "postal_code": "string",
    "country_code": "string"
  },
  "dob": {
    "day": "integer (int64)",
    "month": "integer (int64)",
    "year": "integer (int64)"
  },
  "tos_acceptance": {
    "unix_timestamp": "integer (int64)",
    "ip": "string",
    "user_agent": "string"
  }
}

Role: string , x ∈ { buyer , seller }

Example
"string"

TosAcceptance: object

The time at which and location from which the logged-in user accepted the Trustap Terms of Service and the Stripe Connected Account Agreement.

unix_timestamp: integer (int64)
ip: string
user_agent: string
Example
{
  "unix_timestamp": "integer (int64)",
  "ip": "string",
  "user_agent": "string"
}

Pricing: object

price: integer (int64)
charge: integer (int64)
Example
{
  "price": "integer (int64)",
  "charge": "integer (int64)"
}

BasicListing: object

id: integer (int64)
creator_id: string
currency: string
pricing: Pricing
description: string
created: string
Example
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

P2PListing: object

id: integer (int64)
creator_id: string
currency: string
deposit_pricing: Pricing
description: string
created: string
Example
{
  "id": "integer (int64)",
  "creator_id": "string",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string"
}

Notification: object

id: integer (int64)
created: string
read: string
user_id: string
description: string
target: string
Example
{
  "id": "integer (int64)",
  "created": "string",
  "read": "string",
  "user_id": "string",
  "description": "string",
  "target": "string"
}

BasicTransaction: object

id: integer (int64)
currency: string

The currency of the transaction. Note that, at present, the buyer must pay using the transaction's currency and the seller will be paid in the transaction's currency.

price: integer (int64)
charge: integer (int64)
descr: string
created: string
buyer_id: integer (int64)
seller_id: integer (int64)
joined: string
paid: string
tracked: string
delivered: string
complained: string
complaint: string
funds_released: string
join_code: string
Example
{
  "id": "integer (int64)",
  "currency": "string",
  "price": "integer (int64)",
  "charge": "integer (int64)",
  "descr": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "paid": "string",
  "tracked": "string",
  "delivered": "string",
  "complained": "string",
  "complaint": "string",
  "funds_released": "string",
  "join_code": "string"
}

P2PTransaction: object

id: integer (int64)
currency: string

The currency of the transaction. Note that, at present, the buyer must pay using the transaction's currency and the seller will be paid in the transaction's currency.

deposit_pricing: Pricing
description: string
created: string
buyer_id: integer (int64)
seller_id: integer (int64)
joined: string
rejected: string
cancelled: string
deposit_paid: string
deposit_accepted: string
priced: string
pricing: Pricing
remainder_paid: string
buyer_handover_confirmed: string
seller_handover_confirmed: string
funds_release: string
complaint: string
complained: string
Example
{
  "id": "integer (int64)",
  "currency": "string",
  "deposit_pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "description": "string",
  "created": "string",
  "buyer_id": "integer (int64)",
  "seller_id": "integer (int64)",
  "joined": "string",
  "rejected": "string",
  "cancelled": "string",
  "deposit_paid": "string",
  "deposit_accepted": "string",
  "priced": "string",
  "pricing": {
    "price": "integer (int64)",
    "charge": "integer (int64)"
  },
  "remainder_paid": "string",
  "buyer_handover_confirmed": "string",
  "seller_handover_confirmed": "string",
  "funds_release": "string",
  "complaint": "string",
  "complained": "string"
}