⚙️ Order Creation through APIs
Overview
Transak has introduced a new feature that enables partners to create on-ramp orders directly through APIs, eliminating the need for the Transak Widget. This simplifies the order process, allowing partners to offer their customers a seamless, highly customised, and best-in-class native UI experience.
⭐ Key Benefits
Benefit |
---|
1. UI-Independent Order Placement 🔄 - Place orders via API, no UI required. |
2. Seamless Integration 🔧 - Direct integration for one-click on-ramp purchases. |
3. Supports Bank Transfers 🏦 - Deep integration through API for Bank Transfer payment methods. Your UI, Your control. |
4. Real time Events 🕐 Track Real time events through our Webhook or WebSocket or using Orders API |
🎬 Getting Started
The orders can be created using APIs in just 3 following steps:
Step 1: Get Quote
Get the quote through our Get Price API. This endpoint provides real-time quotes based on parameters such as fiat and cryptocurrency types, payment method, and transaction amount.
Request Example:
curl --request GET \
--url 'https://api-stg.transak.com/api/v1/pricing/public/quotes?partnerApiKey=API_KEY&fiatCurrency=GBP&cryptoCurrency=ETH&isBuyOrSell=BUY&network=ethereum&paymentMethod=gbp_bank_transfer&fiatAmount=100' \
--header 'accept: application/json'
Replace API_KEY
with the actual API key for the respective environment, which can be found in your Partner Dashboard.
Response Example:
{
"response": {
"quoteId": "45c1d748-8a80-47a2-924e-1bba608520b2",
"fiatCurrency": "GBP",
"cryptoCurrency": "ETH",
"paymentMethod": "gbp_bank_transfer",
"fiatAmount": 60,
"cryptoAmount": 0.0233****,
"isBuyOrSell": "BUY",
"network": "ethereum",
...,
}
}
Step 2: Reserve Quote
Once the quoteId
is fetched from Step 1, then reserve the quote using the Reserve Wallet API. This step ensures that the quote is locked for the user’s wallet address.
Request Example:
curl --location --request POST 'https://api-stg.transak.com/api/v2/orders/wallet-reserve' \
--header 'quoteId: 45c1d748-8a80-47a2-924e-1bba608520b2' \
--header 'walletAddress: 0xD902d7e**********EBeBEFeE'
Response Example:
{
"response": {
"id": "45c1d748-8a80-47a2-924e-1bba608520b2"
}
}
Step 3: Create Order
The final step is to create the order using the Create Order API. This API call requires the quoteId
reserved in Step 2, the partner access token, the host address, and the user's email address to successfully create the order.
Request Example:
curl --location 'https://api-stg.transak.com/partners/api/v2/order' \
--header 'access-token: eyJhbGciOiJIUzI1NiaA.eyJBUElfS0VZIjoiZDc5NjcxYTQt.qC4urCCBiQfi' \
--header 'content-type: application/json' \
--header 'user-id: [email protected]' \
--data '{
"quoteId": "45c1d748-8a80-47a2-924e-1bba608520b2",
"hostAddress": "10.10.10.10"
}'
Response Example:
{
"id": "79644f40-3508-48a4-90e2-817131b1087e",
"walletAddress": "0xD902d7eBF7bc5eCa9EEA22a6Ee9F1A30EBe*****",
"createdAt": "2025-01-03T12:34:50.449Z",
"status": "AWAITING_PAYMENT_FROM_USER",
"fiatCurrency": "EUR",
"userId": "243a8ce2-9cc6-41a9-aaeb-b0deeb0b19a3",
"cryptoCurrency": "ETH",
"isBuyOrSell": "BUY",
"fiatAmount": 40,
"ipAddress": "0.0.0.0",
"amountPaid": 0,
"paymentOptionId": "sepa_bank_transfer",
"walletLink": "https://sepolia.etherscan.io/address/0xD902d7eBF7bc5eCa9EEA22a6Ee9F1A30EBe*****",
"quoteId": "af3348c8-01ea-472b-9d4c-53eac10fcb24",
"orderProcessingType": "NORMAL",
"addressAdditionalData": false,
"network": "ethereum",
"conversionPrice": 0.0002951351873733184,
"cryptoAmount": 0.01132434,
"totalFeeInFiat": 1.63,
"fiatAmountInUsd": 41.19,
"countryCode": "IN",
"paymentOptions": [
{
"currency": "EUR",
"id": "sepa_bank_transfer",
"name": "Bank Transfer Details",
"fields": [
{
"name": "Account Type",
"value": "Personal"
},
{
"name": "Amount",
"value": "40 EUR"
},
{
"name": "First Name (Beneficiary)",
"value": "F*****"
},
{
"name": "Last Name (Beneficiary)",
"value": "L*****"
},
{
"name": "IBAN",
"value": "GB57SEOU**********"
},
{
"name": "Bank Name",
"value": "Simulator Bank"
},
{
"name": "Bank Country",
"value": "Malta"
},
{
"name": "Bank Address",
"value": "The Bower, 207-211 Old Street, London, England, EC1V 9NR"
}
]
}
],
"autoExpiresAt": "2025-01-03T13:19:50+00:00",
"campaignAmount": 0,
"campaignAmountInUsd": 0,
"tfPerOff": 0,
"aTtlFees": 1.63,
"aTskFees": 1,
"stateCode": "Karnataka",
"orderChannelType": "API",
"tokenContractAddress": "0x0000000000000000000000000000000000000000",
"userKycType": "STANDARD",
"cardPaymentData": {
"orderId": "79644f40-3508-48a4-90e2-817131b1087e",
"paymentId": "6777d96bf9e3ad8467844318",
"pgData": {
"liquidityProvider": "OPENPAYD_MALTA",
"status": "CREATED",
"beneficiaryName": "A***** J**",
"paymentOptions": [
{
"currency": "EUR",
"id": "sepa_bank_transfer",
"name": "Bank Transfer Details",
"fields": [
{
"name": "Account Type",
"value": "Personal"
},
{
"name": "Amount",
"value": "40 EUR"
},
{
"name": "First Name (Beneficiary)",
"value": "A*****"
},
{
"name": "Last Name (Beneficiary)",
"value": "J**"
},
{
"name": "IBAN",
"value": "GB57SEOU**********"
},
{
"name": "Bank Name",
"value": "Simulator Bank"
},
{
"name": "Bank Country",
"value": "Malta"
},
{
"name": "Bank Address",
"value": "The Bower, 207-211 Old Street, London, England, EC1V 9NR"
}
]
}
]
},
"liquidityProvider": "OPENPAYD_MALTA",
"updatedAt": "2025-01-03T12:34:51.651Z"
},
"lastNotifiedAt": "2025-01-03T12:34:51.999Z",
"statusHistories": [
{
"status": "AWAITING_PAYMENT_FROM_USER",
"createdAt": "2025-01-03T12:34:51.999Z",
"message": "*📦 New order created via API by A***** J** * \n*Order Id:* 79644f40-3508-48a4-90e2-817131b1087e\n*Email:* a*****@t*****.com\n*Crypto Amount:* 0.01132434 ETH\n*Fiat Amount:* 40 EUR\n*Payment Method:* sepa_bank_transfer\n*Liquidity Provider* OPENPAYD_MALTA\n*Wallet Address:* 0xD902d7eBF7bc5eCa9EEA22a6Ee9F1A30EBe*****\n*User Id:* 243a8ce2-9cc6-41a9-aaeb-b0deeb0b19a3 \n*Partner name:* Staging",
"isEmailSentToUser": true,
"partnerEventId": "ORDER_CREATED"
}
],
"isOpenPaydPopup": false
}
Critical Points to Remember
- Pending Orders: If a user has an unresolved order in the "AWAITING_PAYMENT_FROM_USER" state, they cannot place a new order.
- Payment Deadline: After order creation, the user must complete payment within the specified time frame, or the order will expire.
Updated 5 days ago