API: Request examples
Overview
This documentation provides an overview of the API endpoints, showcasing request and response examples for different operations.
The examples use the test environment.
Retrieve a list of integrations
First, you need to retrieve a list of integrations and choose the one through which you want to create an order.
Request
curl -L -X GET 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/integrations' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799'
Response
{
"data": [
{
"name": "test",
"id": "1ef65bda-11ad-63ca-8afe-73770edda314",
"url": "https://example.com",
"status": "active"
},
{
"name": "wer 1",
"id": "1ef4e7cd-0b48-657a-ab8c-65ac066ea2c5",
"url": "https://example.com",
"status": "active"
}
],
"pagination": {
"quantity": 2,
"totalQuantity": 2,
"currentPage": 1,
"pages": 1
}
}
Create an order
Next, create an order using the selected id
.
Request
- deposit order
- payment order
curl -L -X POST 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/order/deposit' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799' \
--data-raw '{
"integrationId": "1ef4e7cd-0b48-657a-ab8c-65ac066ea2c5"
}'
curl -L -X POST 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/order/payment' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799' \
--data-raw '{
"integrationId": "1ef65bda-11ad-63ca-8afe-73770edda314",
"amount": "1",
"assetId": "TRX"
}'
Response
- deposit order
- payment order
{
"orderId": "1ef65c42-8ca5-6b8c-b97c-3f21118559db",
"paymentLink": "https://payment-page.crypto.stage.apicworld.com/payment-page?integrationId=1ef4e7cd-0b48-657a-ab8c-65ac066ea2c5&orderId=1ef65c42-8ca5-6b8c-b97c-3f21118559db",
"widgetCode": "<iframe src=https://payment-page.crypto.stage.apicworld.com/iframe?integrationId=1ef4e7cd-0b48-657a-ab8c-65ac066ea2c5&orderId=1ef65c42-8ca5-6b8c-b97c-3f21118559db width=\"100%\" height=\"800px\" ></iframe>"
}
{
"orderId": "1ef65c5c-8fae-6bf2-91fd-73770edda314",
"paymentLink": "https://payment-page.crypto.stage.apicworld.com/payment-page?integrationId=1ef65bda-11ad-63ca-8afe-73770edda314&orderId=1ef65c5c-8fae-6bf2-91fd-73770edda314",
"widgetCode": "<iframe src=https://payment-page.crypto.stage.apicworld.com/iframe?integrationId=1ef65bda-11ad-63ca-8afe-73770edda314&orderId=1ef65c5c-8fae-6bf2-91fd-73770edda314 width=\"100%\" height=\"800px\" ></iframe>"
}
Retrieve a specific order by ID (optional step)
Check the details of the created order.
Request
- deposit order
- payment order
curl -L -X GET 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/orders/1ef65c42-8ca5-6b8c-b97c-3f21118559db' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799'
curl -L -X GET 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/orders/1ef65c5c-8fae-6bf2-91fd-73770edda314' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799'
Response
- deposit order
- payment order
{
"id": "1ef65c42-8ca5-6b8c-b97c-3f21118559db",
"status": "inProgress",
"createdAt": "2024-08-29T05:04:24+00:00",
"updatedAt": "2024-08-29T05:04:24+00:00"
}
{
"id": "1ef65c5c-8fae-6bf2-91fd-73770edda314",
"status": "inProgress",
"createdAt": "2024-08-29T05:04:24+00:00",
"updatedAt": "2024-08-29T05:04:24+00:00"
}
Payer completes the order
The payer visits the payment page and completes the deposit/payment of 1 TRX.
Retrieve a specific order by ID
Check the status and details of the order.
Request
- deposit order
- payment order
curl -L -X GET 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/orders/1ef65c42-8ca5-6b8c-b97c-3f21118559db' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799'
curl -L -X GET 'https://crypto--crypto-demo.d.apicworld.com/api/gateway/api/v1/orders/1ef65c5c-8fae-6bf2-91fd-73770edda314' \
-H 'Accept: application/json' \
-H 'X-API-Key: 9cb604-d7be11-820606-a0f47e-3b0799'
Response
- deposit order
- payment order
{
"id": "1ef65c42-8ca5-6b8c-b97c-3f21118559db",
"status": "completed",
"createdAt": "2024-08-29T05:04:24+00:00",
"updatedAt": "2024-08-29T05:13:02+00:00",
"primaryAmount": {
"amount": "0.995000",
"currency": "TRX"
},
"secondaryAmount": {
"amount": "0.14",
"currency": "EUR"
},
"serviceFeeAmount": {
"amount": "0.005000",
"currency": "TRX"
},
"totalAmount": {
"amount": "1.000000",
"currency": "TRX"
}
}
{
"id": "1ef65c5c-8fae-6bf2-91fd-73770edda314",
"status": "completed",
"createdAt": "2024-08-29T05:16:02+00:00",
"updatedAt": "2024-08-29T05:34:02+00:00",
"primaryAmount": {
"amount": "0.995000",
"currency": "TRX"
},
"secondaryAmount": {
"amount": "0.14",
"currency": "EUR"
},
"serviceFeeAmount": {
"amount": "0.005000",
"currency": "TRX"
},
"totalAmount": {
"amount": "1.000000",
"currency": "TRX"
}
}