Skip to main content

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.stage.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

curl -L -X POST 'https://crypto.stage.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"
}'

Response

{
"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>"
}

Retrieve a specific order by ID (optional step)

Check the details of the created order.

Request

curl -L -X GET 'https://crypto.stage.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'

Response

{
"id": "1ef65c42-8ca5-6b8c-b97c-3f21118559db",
"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

curl -L -X GET 'https://crypto.stage.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'

Response

{
"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"
}
}