Skip to content

Create a new online transaction with both users

Request

This endpoint is an optimised call that allows a transaction to be created and joined in a single request. It requires the user identified by join_user_id to have granted the basic_tx:offline_create_join scope to the client that is performing the request.

Security
OAuth2 or APIKey
Headers
Trustap-Userstring

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

Bodyapplication/jsonrequired
chargeinteger, (int64)required

The charge value returned from a request to /charge.

Example:78
charge_calculator_versioninteger, (int64)required

The charge_calculator_version value returned from a request to /charge.

Example:5
charge_configinteger, (int64)

The charge config for which the charge amount is computed.

Default:1
Example:1
charge_sellerinteger, (int64)

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

client_idstring
creator_rolestring(basic.Role)required
Enum:"buyer""seller"
Example:"buyer"
currencystringrequired

The currency that the price is specified in.

Example:"eur"
descriptionstringrequired

A description of the goods being sold.

Example:"Soccer ticket"
featuresArray of strings(basic.Feature)

features contains flags that modify the transaction flow.

Items Enum:"require_seller_acceptance""use_hr_post""use_shippo"
Example:
[ "require_seller_acceptance" ]
join_user_idstringrequired

The user that will be joined to the new transaction when it is created. It cannot be the ID of the user making the request.

Example:"feb33a87-3917-4538-9260-127c8a6b5232"
payment_methodstring

The payment method to use for the transaction.

Example:"bank_transfer"
postage_feeinteger, (int64)

The custom postage_fee for the transaction.

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
POST
/api/v1/me/transactions/create_and_join
curl -i -X POST \
  https://dev.stage.trustap.com/api/v1/me/transactions/create_and_join \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Trustap-User: string' \
  -d '{
    "charge": 78,
    "charge_calculator_version": 5,
    "charge_config": 1,
    "creator_role": "seller",
    "currency": "eur",
    "description": "Soccer ticket",
    "join_user_id": "feb33a87-3917-4538-9260-127c8a6b5232",
    "payment_method": "bank_transfer",
    "price": 1234
  }'

Responses

Created

Bodyapplication/json
amount_refundedinteger, (int64)
amount_releasedinteger, (int64)
buyer_idstring
Example:"feb33a87-3917-4538-9260-127c8a6b5232"
cancelledstring, (date-time)
chargeinteger, (int64)required
Example:78
charge_buyer_clientinteger, (int64)required
Example:0
charge_international_paymentinteger, (int64)
charge_postage_buyerinteger, (int64)
charge_postage_clientinteger, (int64)
charge_sellerinteger, (int64)required
Example:0
charge_seller_clientinteger, (int64)required
Example:0
claimed_by_buyerstring, (date-time)
client_idstringrequired
Example:"trustap-app"
complainedstring, (date-time)
complaintobject(Complaint)
Example:
{ "description": "Item was fake" }
complaint_period_deadlinestring, (date-time)
complaint_period_endedstring, (date-time)
createdstring, (date-time)required
Example:"2019-12-25T09:00:00Z"
currencystringrequired

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.

Example:"eur"
deliveredstring, (date-time)
Example:"2019-12-25T13:00:00Z"
deniedstring, (date-time)
descriptionstringrequired
Example:"Soccer ticket"
funds_releasedstring, (date-time)
Example:"2019-12-26T14:00:00Z"
idinteger, (int64)required
Example:1309
image_urlstring, (absolute_url)

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 and svg files. Images displayed as a squares. Non-square images are cropped

is_payment_in_progressbooleanrequired

If the transaction is paid via a delayed payment method, such as SEPA debit, this field will be true until the payment has fully succeeded or failed.

Example:false
join_codestring
joinedstring, (date-time)
Example:"2019-12-25T10:00:00Z"
listing_creator_acceptedstring, (date-time)
listing_creator_rejectedstring, (date-time)
listing_idstring

If the transaction is created from a listing then this is the ID of that listing; otherwise this property is omitted.

listing_typestring(ListingType)
Enum:"single_use""multi_use"
Example:"single_use"
order_issueobject(OrderIssue)
Example:
{ "description": "Delivery delayed" }
order_issue_raisedstring, (date-time)
paidstring, (date-time)
Example:"2019-12-25T11:00:00Z"
payment_acceptedstring, (date-time)
payment_refundedstring, (date-time)
posta_hr_trackingobject(PostaHrTracking)
Example:
{ "barcode": "ABC123456", "barcode_generated": "2019-12-26T14:00:00Z" }
priceinteger, (int64)required
Example:1234
quantityinteger, (int64)required
Example:1
refundsArray of objects(basic.Refund)
released_to_sellerboolean
reviewobject(basic.Review)
review_flaggedstring, (date-time)
seller_idstring
Example:"ad5bb99f-85bf-47e1-be0d-15e7541c6ad7"
shippo_transaction_idstring
statusstringrequired
Example:"funds_released"
trackedstring, (date-time)
Example:"2019-12-25T12:00:00Z"
trackingobject(Tracking)
Example:
{ "carrier": "ups", "tracking_code": "***" }
tracking_details_deadlinestring, (date-time)
tracking_details_window_startedstring, (date-time)
Response
{ "buyer_id": "feb33a87-3917-4538-9260-127c8a6b5232", "charge": 78, "charge_buyer_client": 0, "charge_seller": 0, "charge_seller_client": 0, "client_id": "trustap-app", "created": "2019-12-25T09:00:00Z", "currency": "eur", "delivered": "2019-12-25T13:00:00Z", "description": "Soccer ticket", "funds_released": "2019-12-26T14:00:00Z", "id": 1309, "is_payment_in_progress": false, "joined": "2019-12-25T10:00:00Z", "paid": "2019-12-25T11:00:00Z", "posta_hr_tracking": { "barcode": "ABC12345", "barcode_generated": "2019-12-25T12:00:00Z" }, "price": 1234, "quantity": 1, "seller_id": "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7", "status": "funds_released", "tracked": "2019-12-25T12:00:00Z", "tracking": { "carrier": "ups", "tracking_code": "***" } }