Skip to content

Add items to a transaction

Request

Adds one or more items to a transaction. Items with a recurring_period are billed automatically on that interval.

One-time items can be added at any point, including before the transaction has been paid. Recurring items can only be added once the transaction has been paid.

Security
APIKey or OAuth2
Path
transaction_idstringrequired
Headers
Trustap-Userstring

Required in client flows, where you make API calls on behalf of another Trustap user.

Bodyapplication/jsonrequired
itemsArray of objects(v2_transactions.TransactionItemBody)required
curl -i -X POST \
  -u '<API_KEY>:​' \
  'https://api.test.trustap.com/v2/transactions/{transaction_id}/items' \
  -H 'Content-Type: application/json' \
  -H 'Trustap-User: string' \
  -d '{
    "items": [
      {
        "amount": 0,
        "amount_extra": 0,
        "amount_postage": 0,
        "amount_tax": 0,
        "billing_type": "one_time",
        "description": "string",
        "image_url": "string",
        "quantity": 1,
        "recurring_period": "month",
        "ref_id": "string",
        "tax_code": "string"
      }
    ]
  }'

Responses

OK

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"
itemsArray of objects(v2_transactions.TransactionItem)

The items added to the transaction.

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": "9097", "is_guest": false }, "client_id": "1234", "deadlines": { "complaints": "2019-12-25T15:00:00Z" }, "description": "Soccer ticket", "events": { "by_key": { … }, "by_time": [] }, "funds_release": { "refunds": [], "released_to_seller": false }, "id": "tx_21066", "pricing": { "amount": 1000, "amount_extra": 0, "currency": "eur", "fees": { … } }, "review": { "approved": true, "outcome_reason": "Not fraudulent." }, "seller": { "id": "9790", "is_guest": false }, "status": "funds_released" }