Skip to content

Create a new transaction

Request

Offline access is allowed for this endpoint.

Security
APIKey
Bodyapplication/jsonrequired
amountinteger, (int64)required

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 body would contain {"amount": 1234, "currency": "usd"}.

amount_extrainteger, (int64)

Represents an additional charge to be paid by the buyer added to the transaction total. Use this field to include costs like processing fees or local taxes. Must be an integer provided in the smallest unit of the currency (for example, 500 for $5.00 USD). Defaults to 0 if not provided.

amount_postageinteger, (int64)

Represents an additional charge to be paid by the buyer, seller or client. Use this field to include costs like shipping surcharges. Must be an integer provided in the smallest unit of the currency (for example, 500 for $5.00 USD).

buyer_idstring

The ID of the user that will be the buyer in this transaction.

contains_shippingboolean

Specifies if the transactions contains a shippable item and the shipping details should be collected from the buyer.

currencystring, (currency)required

The currency that the amount is specified in.

descriptionstringrequired

A description of the goods being sold.

fees_buyerinteger, (int64)required

The buyer fees for this transaction, in the currency's smallest unit.

fees_configinteger, (int64)

The fee config for which the fees are computed.

fees_sellerinteger, (int64)

The seller fees for this transaction, in the currency's smallest unit.

image_urlstring, (absolute_url), <= 2047 characters

URL of the image displayed on the Trustap payment page to show the buyer the item they are paying for. Supports jpg, png, gif, bmp, webp and svg files. Images displayed as a squares. Non-square images are cropped.

payment_methodstring

The payment method that will be used to pay for the transaction. This is necessary because different payment methods may result in different fees. Supports card and bank_transfer.

The default value is card.

rolestring

The role of the user creating the transaction. Supported values are buyer and seller.

seller_idstring

The ID of the user that will be the seller in this transaction.

POST
/v2/transactions
curl -i -X POST \
  -u '<API_KEY>:​' \
  https://api.test.trustap.com/v2/transactions \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": 0,
    "amount_extra": 0,
    "amount_postage": 0,
    "buyer_id": "string",
    "contains_shipping": true,
    "currency": "string",
    "description": "string",
    "fees_buyer": 0,
    "fees_config": 0,
    "fees_seller": 0,
    "image_url": "string",
    "payment_method": "string",
    "role": "string",
    "seller_id": "string"
  }'

Responses

Created

Bodyapplication/json
buyerobject(v2_transactions.User)
Example:
{ "id": "9097", "is_guest": false }
cancellationobject
client_idstringrequired
Example:"1234"
complaintobject
contains_shippingboolean
deadlinesobjectrequired

This property contains all possible actions that have associated deadlines for completion. Actions with null do not have deadlines currently pending.

Example:
{ "complaints": "2019-12-25T15:00:00Z" }
descriptionstringrequired
Example:"Soccer ticket"
eventsobject(v2_transactions.Events)required
Example:
{ "by_key": { "created": "2019-12-25T09:00:00Z", "delivered": "2019-12-25T16:00:00Z", "funds_released": "2019-12-25T17:00:00Z", "joined": "2019-12-25T10:00:00Z", "paid": "2019-12-25T11:00:00Z", "payment_accepted": "2019-12-25T12:00:00Z" }, "by_time": [] }
funds_releaseobject
Example:
{ "refunds": [], "released_to_seller": false }
idstring, (type_id)required
Example:"tx_21066"
join_codestring
metadataobject

Arbitrary key-value string pairs for adding extra information to transactions.

order_issueobject
pricingobject(v2_transactions.Pricing)required
Example:
{ "amount": 1000, "amount_extra": 0, "currency": "eur", "fees": { "buyer": 110, "buyer_client": 10, "international_payment": 20, "seller": 0, "seller_client": 5 } }
reviewobject
Example:
{ "approved": true, "outcome_reason": "Not fraudulent." }
sellerobject(v2_transactions.User)
Example:
{ "id": "9097", "is_guest": false }
statusstring(v2_transactions.Status)required
Enum:"created""joined""rejected""cancelled""paid""review_flagged""payment_accepted""complaint_submitted""complaint_period_ended""refunded"
Example:"funds_released"
trackingobject(v2_transactions.Tracking)
Response
{ "buyer": { "id": "1-def29dfe-8626-48a2-8863-b6fdf2b96ff1", "is_guest": true }, "client_id": "5ad5451d-70c7-43c6-86c9-e1d90556856c", "deadlines": { "complaints": null }, "description": "Trustap socks", "events": { "by_key": {}, "by_time": [] }, "funds_release": { "refunds": [], "released_to_seller": false }, "id": "tx_01kysvfb1ff1j8st5akj3vqknf", "metadata": {}, "payment_link": "https://actions.stage.trustap.com/transactions/tx_01kysvfb1ff1j8st5akj3vqknf/pay", "pricing": { "amount": 20000, "amount_extra": 200, "amount_postage": 500, "currency": "gbp", "fees": {}, "postage_bearer": "buyer" }, "seller": { "id": "8e5cbedc-e57b-42e5-a3bd-2f9ced81a2d0", "is_guest": false }, "status": "joined" }