POST
/
instant-swaps
curl --request POST \
--url https://api-staging.stablestack.xyz/api/instant-swaps \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{
"customer_id": "85b148ab-3f6b-4d55-917f-3c8de668a48e",
"from_currency": "USDT",
"to_currency": "USDC",
"amount": "20"
}'
{
"status": "success",
"data": {
"status": "success",
"message": "Successful",
"data": {
"id": "751935b6-4574-4837-90d6-5039d2c165dd",
"from_currency": "USDT",
"to_currency": "USDC",
"quoted_price": "0.9802941274500001",
"quoted_currency": "USDC",
"from_amount": "20.0",
"to_amount": "19.6",
"confirmed": false,
"expires_at": "2025-05-13T13:24:46.000Z",
"created_at": "2025-05-13T13:24:31.000Z",
"updated_at": "2025-05-13T13:24:31.000Z",
"user": {
"id": "97075f40-1885-4034-92f6-e3e61c0679c5",
"sn": "QDXTF3IK5BH",
"email": "contact@akande.com",
"reference": null,
"first_name": "Akande Enterprises",
"last_name": "Akande Enterprises",
"display_name": null,
"created_at": "2025-05-01T21:03:56.000Z",
"updated_at": "2025-05-01T21:03:56.000Z"
}
}
}
}

Creates an instant currency swap between supported assets. Supports both customer and merchant-initiated swaps.

Key Features:

  • Instant conversion between supported currencies
  • Returns quoted price and conversion amounts
  • Supports both customer and merchant swaps
  • Provides expiration time for quoted rate
  • Detailed user information in response

Request Body:

Customer Swap:

{
  "customer_id": "85b148ab-3f6b-4d55-917f-3c8de668a48e",
  "from_currency": "USDT",
  "to_currency": "USDC",
  "amount": "20"
}

Merchant Swap:

{
  "from_currency": "USDT",
  "to_currency": "USDC",
  "amount": "20"
}

Headers

x-api-key
string
required

Body

application/json

Response

200
application/json

Swap created successfully

The response is of type object.