You can use the Trustap API to generate and purchase shipping labels. Trustap uses Shippo to generate shipping labels. These shipping labels can be printed by sellers, attached to parcels, and used to transport items to a buyer.
Use the following flow to add shipping to an online transaction.
Follow our users guide to create user IDs for both seller and buyer.
Before creating a transaction, retrieve the charge for the transaction. This returns the cost for using the Trustap service for this transaction.
price is an integer, in which the last 2 digits are the decimal part of the price. For example, price:1050 currency:eur = 10,50€.
curl --location 'https://dev.stage.trustap.com/api/v1/charge?price=20000¤cy=gbp' \
--user '<API_KEY>:'To enable shipping for a transaction, include use_shippo and require_seller_acceptance in features when creating the transaction.
"features": ["use_shippo", "require_seller_acceptance"]curl --location 'https://dev.stage.trustap.com/api/v1/me/transactions/create_with_guest_user' \
--header 'Trustap-User: 1-886e3c26-b585-4c92-a93b-e3c84b9b32e9' \
--header 'Content-Type: application/json' \
--user '<API_KEY>:' \
--data '{
"seller_id": "1-886e3c26-b585-4c92-a93b-e3c84b9b32e9",
"buyer_id": "1-615a70d4-b624-4243-95be-a8367b7953ea",
"creator_role": "seller",
"currency": "gbp",
"description": "Online no deposit",
"price": 20000,
"charge": 720,
"charge_calculator_version": 5,
"payment_method": "card",
"features": ["use_shippo", "require_seller_acceptance"]
}'Add your sender`s address. To receive an accurate shipping rate estimation, it is important to use an accurate address.
For country, use ISO 3166-1 alpha-2 country codes.
While not required, some shipping carriers may need an email addresses for both your seller and buyer. Add these when adding addresses.
curl --location 'https://dev.stage.trustap.com/api/v1/transactions/25439/shippo_address' \
--user '<API_KEY>:' \
--header 'Content-Type: application/json' \
--data '{
"city": "London",
"country": "GB",
"full_name": "Sarah Garcia",
"phone": "4215559099",
"state": "London",
"street_1": "12 Abercrombie Rd",
"zip_code": "E20 3AB",
"email":"sarah.garcia@shopit.com",
"is_sender_address": true
}'Add your recipient`s address. It is important to use an accurate address to avoid issues in shipping rate estimation and parcel delivery.
For country, use ISO 3166-1 alpha-2 country codes.
curl --location 'https://dev.stage.trustap.com/api/v1/transactions/25439/shippo_address' \
--user '<API_KEY>:' \
--header 'Content-Type: application/json' \
--data '{
"city": "Manchester",
"country": "GB",
"full_name": "Bert Gray",
"phone": "123456789",
"zip_code": "M11 4DQ",
"state": "Manchester",
"street_1": "42 Stuart St",
"email":"bert.gray@my-mail.com",
"is_sender_address": false
}'Add parcel details. These are the physical characteristics of your parcel. It's important to use accurate parcel details as they are used to determine the most appropriate shipping options for your parcel.
curl --location 'https://dev.stage.trustap.com/api/v1/transactions/25439/shippo_parcel_details' \
--user '<API_KEY>:' \
--header 'Content-Type: application/json' \
--data '{
"distance_unit": "cm",
"height": 10,
"length": 10,
"mass_unit": "lb",
"weight": 10,
"width": 10,
"shipment_date": "2025-11-18T00:35:03.463Z"
}'A customs declaration is a record of the details about the contents of a parcel. For international shipping, this is required. It ensures compliance with import and export regulations and helps determine duties, taxes, and restrictions.
curl --location 'https://dev.stage.trustap.com/api/v1/transactions/25439/shippo_customs_declaration' \
--user '<API_KEY>:' \
--header 'Content-Type: application/json' \
--data '{
"certify": true,
"certify_signer": "Bert Gray",
"description": "T-Shirt",
"incoterm": "DDU",
"mass_unit": "lb",
"net_weight": 10,
"non_delivery_option": "return",
"origin_country": "GB",
"quantity": 1,
"value_amount": "200",
"value_currency": "GBP"
}'Find shipping rates available to ship the seller's parcel.
curl --location 'https://dev.stage.trustap.com/api/v1/transactions/25439/shippo_shipping_rates' \
--user '<API_KEY>:'Select a rate returned from shippo_shipping_rates using the id of your preferred rate.
curl --location --globoff 'https://dev.stage.trustap.com/api/v1/transactions/25439/shippo_shipping_rate' \
--header 'Trustap-User: 1-886e3c26-b585-4c92-a93b-e3c84b9b32e9' \
--header 'Content-Type: application/json' \
--user '<API_KEY>:'\
--data '{
"rate_id": "417bb46e734c457e97316122081cf99f"
}'After a transaction is created, the buyer should be redirected to the payment page to pay for it. The cost of the transaction includes both the Trustap fee and shipping fee.
The seller must accept the payment. At this point, the shipping label is purchased.
curl --location --globoff --request POST 'https://dev.stage.trustap.com/api/v1/transactions/25439/accept_payment_with_guest_seller' \
--header 'Trustap-User: 1-886e3c26-b585-4c92-a93b-e3c84b9b32e9' \
--user '<API_KEY>:'The shipping label is available to download, print, and attach to the parcel using label_url. Tracking details are also available through tracking_code and tracking_url.
curl --location --globoff 'https://dev.stage.trustap.com/api/v1/transactions/25372/shippo_shipping_label' \
--header 'Trustap-User: 1-615a70d4-b624-4243-95be-a8367b7953ea' \
--user '<API_KEY>:'When the Trustap API receives confirmation from the carrier that the parcel has been delivered, delivery will automatically be confirmed.
Optionally, the buyer or the seller can manually confirm delivery.
curl --location --globoff --request POST 'https://dev.stage.trustap.com/api/v1/transactions/25372/confirm_delivery_with_guest_buyer' \
--header 'Trustap-User: 1-615a70d4-b624-4243-95be-a8367b7953ea' \
--user '<API_KEY>:' \At this point, the buyer has an option to create a complaint. This means that were not satisfied with the transaction. A complaint will pause any payout until the dispute has been resolved.
See our guide to create a complaint.
- A seller must register for a full Trustap account before they can claim a transaction. See our full user guide for details.
- Using the seller full Trustap account user ID as
Trustap-User, claim the transaction. This links the transaction to their full Trustap account.
curl --location --request POST 'https://dev.stage.trustap.com/api/v1/transactions/25273/claim_for_seller' \
--header 'Trustap-User: b9c9e108-1edd-5d5e-8268-8873d7beb3e3' \
--user '<API_KEY>:'- Following confirmation of delivery and a successful complaints period, the seller will receive the payout from the transaction to their account.