POST
/
swaps
/
{swapId}
/
refresh
curl --request POST \
--url https://api-staging.stablestack.xyz/api/swaps/{swapId}/refresh \
--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",
"from_amount": "20"
}'
{
  "status": "success",
  "data": {
    "status": "success",
    "message": "Successful",
    "data": {
      "id": "324bc043-688f-4c78-9952-02fa7ab92331",
      "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:25:16.000Z",
      "created_at": "2025-05-13T13:22:25.000Z",
      "updated_at": "2025-05-13T13:25:01.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"
      }
    }
  }
}

Refreshes the quoted price for an existing currency swap. Maintains the same swap ID while updating the exchange rate and expiration time.

Key Features:

  • Updates the quoted exchange rate for an existing swap
  • Extends the expiration time of the quote
  • Preserves all original swap details
  • Supports both customer and merchant swaps
  • Returns updated swap information with new rate

Path Parameters:

  • swapId: The ID from create instant swap (UUID, required). e.g "id": "1795e32f-1b1d-47e5-97b4-c8f022da3e87"

Request Body:

Customer Refresh:

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

Merchant Refresh:

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

Headers

x-api-key
string
required

Path Parameters

swapId
string
required

The ID from create instant swap (UUID, required). e.g id:1795e32f-1b1d-47e5-97b4-c8f022da3e87

Body

application/json

Response

200
application/json

Swap refreshed successfully

The response is of type object.