The Trustap API enables sellers to use their own shipping solutions and provide a mechanism to add tracking details to a transaction. To support sellers using their own shipping solution, the Trustap API includes a postage_fee parameter. Use this to add a pre-calculated postage cost to a transaction, which is then collected at the payment screen.
- 1
Create users
Follow our users guide to create user objects for both seller and buyer.
- 2
Calculate the charge
Before creating a transaction, retrieve the charge for the transaction. This returns the cost for using the Trustap service for this transaction.
priceis an integer, in which the last 2 digits are the decimal part of the price. For example,price:1050currency:eur= €10.50.Get the charge for the transaction including the path parameter
amount_postage.curl -i -X GET \ -u '<API_KEY>:' \ 'https://api.test.trustap.com/v2/fees?amount=20000¤cy=gbp&amount_postage=500' - 3
Create transaction
In your transaction, include the postage fee as
amount_postage. Amounts must be provided in a currency's smallest unit. For example, use500for €5.curl -i -X POST \ -u '<API_KEY>:' \ https://api.test.trustap.com/v2/transactions \ -H 'Content-Type: application/json' \ -d '{ "amount": 20000, "amount_extra": 0, "buyer_id": "1-506ec116-f0b3-4ea8-bfd0-ea0e7b9d18aa", "currency": "eur", "description": "Trustap socks", "fees_buyer": 1075, "fees_config": 1, "fees_seller": 0, "amount_postage": 500, "image_url": "https://docs.trustap.com/images/trustap-socks.png", "payment_method": "card", "role": "seller", "contains_shipping": true, "seller_id": "8e5cbedc-e57b-42e5-a3bd-2f9ced81a2d0" }' - 4
Send buyer to payment screen
Direct your buyer to the payment screen.
https://actions.stage.trustap.com/transactions/tx_01kvcyk6dhf4crpbs5phe6vspa/pay?redirect_uri=https://www.example.com
The collected postage fees are held in the Trustap vault and paid out to the platform at agreed intervals, in a similar manner to partner commission.