Instant Swap API

Basic Info

All requests should use the domain:
API URL:https://api.pegasusswap.cx
Protocol: HTTPS only.
Authentication: All endpoints require valid API credentials.
All requests to be executed using HTTPS and following parameters should be used in headers:
Headers
Acceptapplication/json
Content-Typeapplication/json

Authorization process

For all requests, an authorization key is required. It grants access to all functions.
These parameters should be included in the headers to configure API authorization:
Request parameters:
Headers
x-api-public-key{publicKey}
x-api-signature{signature}
x-api-payload{payload}
signature = hex(HMAC_SHA512(payload, key=api_secret))
In the payload field of the request header, you must pass the exact API name of the request you are making. For example, for a request to api/private/get-all-coins, the payload value should be get-all-coins and so on.
Payload meaning:
API EndpointPayload
/api/private/get-all-coinsget-all-coins
/api/private/get-coin-networkget-coin-network
/api/private/exchange-coinexchange-coin
/api/private/get-transactionget-transaction
/api/private/create-transactioncreate-transaction

Available Currencies List

This API endpoint provides a paginated list of all available currencies.
GET:https://api.pegasusswap.cx/api/private/get-all-coins
Parameters:
NameTypeRequired or optionalDescription
pagenumberoptionalCurrent page
limitnumberoptionalLimit per page
searchstringoptionalSearch by currency name
methodnumberoptionalMethod 1 we get an array with coins for deposit. Method 2 we get an array with coins for output
depositCoin stringoptionalDeposit coin
receiveCoinstringoptionalReceive coin
depositNetworkstringoptionalDeposit network
receiveNetworkstringoptionalReceive network
Successful response fields:
NameTypeDescription
pagination:objectPagination
    pageCountnumberPage count
    totalCountnumberTotal items
depositCoins / withdrawCoinsarrayList with coins
    imagestringCoin image
    subNamestringCoin sub name
    namestringCoin name
    networksobjectCoin networks
        deposits / withdrawsarrayDeposits or withdraws networks
            subNamestringNetwork name
            memoNeededbooleanNetwork has extra ID
Example request:
GET:https://api.pegasusswap.cx/api/private/get-all-coins?page=1&limit=5&method=1
Example response:
{
  "pagination": {
    "pageCount": 52,
    "totalCount": 260
  },
  "depositCoins": [
    {
      "image": "example/USDT.png",
      "subName": "USDT",
      "name": "TetherUS",
      "networks": {
        "deposits": [
          {
            "subName": "TRX",
            "memoNeeded": true
          }
        ]
      }
    }
  ]
}

Retrieve Currency Networks

This API endpoint provides the networks associated with a specific currency code.
GET:https://api.pegasusswap.cx/api/private/get-coin-network
Parameters:
NameTypeRequired or optionalDescription
coinstringrequiredCurrency code (Coin sub name)
Successful response fields:
NameTypeDescription
depositarrayList with deposit networks
withdrawsarrayList with withdraws networks
    subNamestringSub name network
Example request:
GET:https://api.pegasusswap.cx/api/private/get-coin-network?coin=eth
Example response:
{
  "deposit": [
    {
      "subName": "ERC20"
    }
  ],
  "withdraws": [
    {
      "subName": "ERC20"
    }
  ]
}

Swap Pair Information

This API endpoint provides the amount the user will receive, the current swap rate.
GET:https://api.pegasusswap.cx/api/private/exchange-coin
Parameters:
NameTypeRequired or optionalDescription
amountstringrequiredAmount of currency you are going to send or get
coinFromstringrequiredCurrency to swap from
coinTostringrequiredCurrency to swap to
networkFromstringoptionalNetwork to swap from
networkTostringoptionalNetwork to swap to
lastSourcestringrequiredWe transfer the last input where the data is entered, to the deposit input or the receive input ( for example deposit or receive)
typeSwapstringrequired1 - fixed 2 -float
Successful response fields:
NameTypeDescription
pairstringSwap pair
amountnumberAmount sent
exchangeRatenumberSwap rate
receivenumberAmount you will receive
minAmountnumberMin deposit
maxAmountnumberMax deposit
Example request:
GET:https://api.pegasusswap.cx/api/private/exchange-coin?amount=10&coinFrom=eth&coinTo=usdt&lastSource=deposit&typeSwap=1
Example response:
{
  "pair": "ETH_USDT",
  "amount": "10",
  "exchangeRate": 2462.1076313215262,
  "receive": 24008.541206617498,
  "minAmount": 0.03,
  "maxAmount": 2100
}

Retrieve Swap Information

This API endpoint provides details about a specific swap.
GET:https://api.pegasusswap.cx/api/private/get-transaction
Parameters:
NameTypeRequired or optionalDescription
idstringrequiredSwap ID
Successful response fields:
NameTypeDescription
typeobjectAn object containing the type of swap (fixed or floating rate)
    typeSwapnumberA type of swap where 1 - Fixed, 2 - Float
pairsobjectAn object containing information about coin pairs for deposit and withdrawal
    deposit/receiveobjectAn object containing information about a coin for deposit and withdrawal
        coinobjectAn object containing information out of a coin for deposit and withdrawal
            namestringCoin name (eg BTC, XMR)
            valuenumberThe number of coins that will be sent or received
            networkstringThe network in which the transaction takes place (eg ERC20, XMR)
            fullNamestringThe full name of the coin
        addressstringAddress to send or receive coins
        memostringMemo for transaction
receiveTransactionobjectAn object containing information about the received transaction
    txIdstringReceive transaction id
    addressstringAddress to receive coins
    receivedTimestringThe time the transaction was received
    gettingInTheBlockstringThe time of receiving the first sending confirmation
    amountnumber | nullNumber of coins sending
swapTimeobjectAn object containing the swap time
    endstringTransaction completion time
    durationstringDuration of the transaction
    startstringTransaction start time
orderNumberstringThe unique identifier of the transaction
statusnumberNew - 9; Confirmation - 1; Exchanging - 3; Success - 4; Sending - 12; Overdue - 5; Error - 6; Pause - 10; Stuck - 11; Refund - 13
txIdstringDeposit transaction id
refundAddressstringAddress used to refund the deposit if the swap fails
receivedTimestringDeposit receiving time
gettingInTheBlockstringThe time of receiving the first deposit confirmation
confirmationnumber | nullNumber of confirmations for the transaction for deposit
createdAtstringTransaction creation time
Example request:
GET:https://api.pegasusswap.cx/api/private/get-transaction?id=RTGTLN
Example response:
{
  "type": {
    "typeSwap": 2
  },
  "pairs": {
    "deposit": {
      "coin": {
        "name": "BTC",
        "value": 0.00047,
        "network": "BTC",
        "fullName": "Bitcoin"
      },
      "address": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
      "memo": ""
    },
    "receive": {
      "coin": {
        "name": "XMR",
        "value": 5.7084594,
        "network": "XMR",
        "fullName": "Monero"
      },
      "address": "87bsQNEnRRe56A6ERMLmwDCanjkoN6Q2eFwCFqi5tLAQcwzvxDj6rxZUAa2rRPqvX8a6fdpoerpxnNSRTPyAFt4zJsDvZcB",
      "memo": ""
    }
  },
  "receiveTransaction": {
    "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
    "address": "49ALvhFRnJm4n1JsBG2fiAcrpPXeGEUvrLCvUjXNr9TqLk74pmj9X7s9aprrzRNNWHUgRrYbmysN7Xs8UJijXumPTjV5WVb",
    "receivedTime": "1781521720369",
    "gettingInTheBlock": "1781521800928",
    "amount": 0.37555349507259705
  },
  "swapTime": {
    "end": "2026-06-15T11:10:00.928Z",
    "duration": "1m",
    "start": "2026-06-15T13:33:20.248Z"
  },
  "orderNumber": "F723NT",
  "status": 4,
  "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
  "refundAddress": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
  "receivedTime": "1781520980314",
  "gettingInTheBlock": "1781520980314",
  "confirmation": 3,
  "createdAt": "2026-06-15T10:38:53.613Z"
}

Retrieve Swaps Information

This API endpoint returns a paginated list of all swaps that belong to the partner.
GET:https://api.pegasusswap.cx/api/private/get-transactions
Parameters:
NameTypeRequired or optionalDescription
pagenumberoptionalPage number to retrieve. Defaults to 1
limitnumberoptionalNumber of swaps per page. Defaults to 20, maximum 100
dateFromstringoptionalFilters transactions created on or after the specified date
dateTostringoptionalFilters transactions created on or before the specified date
Date format: Use the ISO 8601 UTC format YYYY-MM-DDTHH:mm:ss.sssZ. The Z suffix indicates UTC.
Successful response fields:
NameTypeDescription
paginationobjectAn object containing pagination information
    pageCountnumberTotal number of pages available
    totalCountnumberTotal number of swaps for the partner
transactionsarrayAn array of swap objects (see fields below)
Swap object fields:
NameTypeDescription
typeobjectAn object containing the type of swap (fixed or floating rate)
    typeSwapnumberA type of swap where 1 - Fixed, 2 - Float
pairsobjectAn object containing information about coin pairs for deposit and withdrawal
    deposit/receiveobjectAn object containing information about a coin for deposit and withdrawal
        coinobjectAn object containing information out of a coin for deposit and withdrawal
            namestringCoin name (eg BTC, XMR)
            valuenumberThe number of coins that will be sent or received
            networkstringThe network in which the transaction takes place (eg ERC20, XMR)
            fullNamestringThe full name of the coin
        addressstringAddress to send or receive coins
        memostringMemo for transaction
receiveTransactionobjectAn object containing information about the received transaction
    txIdstringReceive transaction id
    addressstringAddress to receive coins
    receivedTimestringThe time the transaction was received
    gettingInTheBlockstringThe time of receiving the first sending confirmation
    amountnumber | nullNumber of coins sending
swapTimeobjectAn object containing the swap time
    endstringTransaction completion time
    durationstringDuration of the transaction
    startstringTransaction start time
orderNumberstringThe unique identifier of the transaction
statusnumberNew - 9; Confirmation - 1; Exchanging - 3; Success - 4; Sending - 12; Overdue - 5; Error - 6; Pause - 10; Stuck - 11; Refund - 13
txIdstringDeposit transaction id
refundAddressstringAddress used to refund the deposit if the swap fails
refundMemostringMemo or destination tag for the refund address, when required by the selected currency or network
receivedTimestringDeposit receiving time
gettingInTheBlockstringThe time of receiving the first deposit confirmation
confirmationnumber | nullNumber of confirmations for the transaction for deposit
createdAtstringTransaction creation time
Example request:
GET:https://api.pegasusswap.cx/api/private/get-transactions?page=1&limit=20&dateFrom=2026-07-03T00:00:00.346Z&dateTo=2026-08-03T23:59:59.346Z
Example response:
{
  "pagination": {
    "pageCount": 1,
    "totalCount": 2
  },
  "transactions": [
    {
      "type": {
        "typeSwap": 2
      },
      "pairs": {
        "deposit": {
          "coin": {
            "name": "BTC",
            "value": 0.00047,
            "network": "BTC",
            "fullName": "Bitcoin"
          },
          "address": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
          "memo": ""
        },
        "receive": {
          "coin": {
            "name": "XMR",
            "value": 5.7084594,
            "network": "XMR",
            "fullName": "Monero"
          },
          "address": "87bsQNEnRRe56A6ERMLmwDCanjkoN6Q2eFwCFqi5tLAQcwzvxDj6rxZUAa2rRPqvX8a6fdpoerpxnNSRTPyAFt4zJsDvZcB",
          "memo": ""
        }
      },
      "receiveTransaction": {
        "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
        "address": "49ALvhFRnJm4n1JsBG2fiAcrpPXeGEUvrLCvUjXNr9TqLk74pmj9X7s9aprrzRNNWHUgRrYbmysN7Xs8UJijXumPTjV5WVb",
        "receivedTime": "1781521720369",
        "gettingInTheBlock": "1781521800928",
        "amount": 0.37555349507259705
      },
      "swapTime": {
        "end": "2026-06-15T11:10:00.928Z",
        "duration": "1m",
        "start": "2026-06-15T13:33:20.248Z"
      },
      "orderNumber": "F723NT",
      "status": 4,
      "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
      "refundAddress": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
      "refundMemo": "123456789",
      "receivedTime": "1781520980314",
      "gettingInTheBlock": "1781520980314",
      "confirmation": 3,
      "createdAt": "2026-06-15T10:38:53.613Z"
    }
  ]
}

Initiate Transaction

This API endpoint creates a new transaction, generates an address for fund transfer, and returns the transaction details.
POST:https://api.pegasusswap.cx/api/private/create-transaction
Parameters:
NameTypeRequired or optionalDescription
depositCoinstringrequiredCoin from deposit
depositAmountnumberrequiredAmount from deposit
depositNetworkstringrequiredAddress from deposit
receiveAddressstringrequiredAddress from receive
receiveCoinstringrequiredCoin from receive
receiveNetworkstringrequiredNetwork from receive
typeSwapnumberrequired1 - fixed, 2 -float
refundAddressstringoptionalRefund address
refundMemostringoptionalMemo or destination tag to be used if a refund is required
memostringoptionalIf needed memo
lastSourcestringrequiredDeposit or receive
Successful response fields:
NameTypeDescription
typeobjectAn object containing the type of swap (fixed or floating rate)
    typeSwapnumberA type of swap where 1 - Fixed, 2 - Float
pairsobjectAn object containing information about coin pairs for deposit and withdrawal
    deposit/receiveobjectAn object containing information about a coin for deposit and withdrawal
        coinobjectAn object containing information out of a coin for deposit and withdrawal
            namestringCoin name (eg BTC, XMR)
            valuenumberThe number of coins that will be sent or received
            networkstringThe network in which the transaction takes place (eg ERC20, XMR)
            fullNamestringThe full name of the coin
        addressstringAddress to send or receive coins
        memostringMemo for transaction
receiveTransactionobjectAn object containing information about the received transaction
    txIdstringReceive transaction id
    addressstringAddress to receive coins
    receivedTimestringThe time the transaction was received
    gettingInTheBlockstringThe time of receiving the first sending confirmation
    amountnumber | nullNumber of coins sending
swapTimeobjectAn object containing the swap time
    endstringTransaction completion time
    durationstringDuration of the transaction
    startstringTransaction start time
orderNumberstringThe unique identifier of the transaction
statusnumberNew - 9; Confirmation - 1; Exchanging - 3; Success - 4; Sending - 12; Overdue - 5; Error - 6; Pause - 10; Stuck - 11; Refund - 13
txIdstringDeposit transaction id
refundMemostringMemo or destination tag for the refund address, when required by the selected currency or network
receivedTimestringDeposit receiving time
gettingInTheBlockstringThe time of receiving the first deposit confirmation
confirmationnumber | nullNumber of confirmations for the transaction for deposit
createdAtstringTransaction creation time
Example request:
POST:https://api.pegasusswap.cx/api/private/create-transaction
Example response:
{
  "type": {
    "typeSwap": 2
  },
  "pairs": {
    "deposit": {
      "coin": {
        "name": "BTC",
        "value": 0.00047,
        "network": "BTC",
        "fullName": "Bitcoin"
      },
      "address": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
      "memo": ""
    },
    "receive": {
      "coin": {
        "name": "XMR",
        "value": 5.7084594,
        "network": "XMR",
        "fullName": "Monero"
      },
      "address": "87bsQNEnRRe56A6ERMLmwDCanjkoN6Q2eFwCFqi5tLAQcwzvxDj6rxZUAa2rRPqvX8a6fdpoerpxnNSRTPyAFt4zJsDvZcB",
      "memo": ""
    }
  },
  "receiveTransaction": {
    "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
    "address": "49ALvhFRnJm4n1JsBG2fiAcrpPXeGEUvrLCvUjXNr9TqLk74pmj9X7s9aprrzRNNWHUgRrYbmysN7Xs8UJijXumPTjV5WVb",
    "receivedTime": "1781521720369",
    "gettingInTheBlock": "1781521800928",
    "amount": 0.37555349507259705
  },
  "swapTime": {
    "end": "2026-06-15T11:10:00.928Z",
    "duration": "1m",
    "start": "2026-06-15T13:33:20.248Z"
  },
  "orderNumber": "F723NT",
  "status": 4,
  "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
  "refundMemo": "123456789",
  "receivedTime": "1781520980314",
  "gettingInTheBlock": "1781520980314",
  "confirmation": 3,
  "createdAt": "2026-06-15T10:38:53.613Z"
}

Update Refund Address

This API endpoint allows a partner to add or update the refund address for a specific, existing transaction that they own.
PATCH:https://api.pegasusswap.cx/api/private/update-refund-address
Request Body Parameters:
NameTypeRequired or optionalDescription
idstringrequiredThe unique identifier (orderNumber) of the transaction to update
refundAddressstringrequiredThe new refund address to be set for the specified transaction
refundMemostringoptionalMemo or destination tag for the refund address, when required by the selected currency or network
Successful response fields:
NameTypeDescription
messagestringA confirmation message indicating success
orderNumberstringThe unique identifier of the updated transaction
newRefundAddressstringThe refund address that was successfully set
newRefundMemostringUpdated memo or destination tag for the refund address
Example request:
PATCH:https://api.pegasusswap.cx/api/private/update-refund-address
{
  "id": "RBGTSM",
  "refundAddress": "ltc1q...your...refund...address...here",
  "refundMemo": "123456789"
}
Example response:
{
  "message": "Refund address updated successfully",
  "orderNumber": "RBGTSM",
  "newRefundAddress": "ltc1q...your...refund...address...here",
  "newRefundMemo": "123456789"
}

Webhook Integration Guide

Overview
Our service sends webhook events whenever a partner transaction is updated.
Current event type:

  transaction.updated
This webhook allows your system to receive transaction updates automatically without continuously polling the API.
HTTP request format
Our service sends webhook requests in the following format:

  Method: POST
  Content-Type: application/json
  
Additionally, each request includes a signature header:

  X-Webhook-Signature: t=<unix_timestamp>,v1=<hmac_hex>
Signature header example
X-Webhook-Signature: t=1710000000,v1=abcdef1234567890...

Where:
  t - Unix timestamp of when the signature was generated
  v1 - HMAC SHA256 signature of the request
Webhook signature verification
Signature verification is required.
It ensures that the request was sent by our service and was not forged by a third party.
Verification Algorithm

  1. Extract t from the X-Webhook-Signature header
  2. Read the raw request body as a string
  3. Build the signed payload in the following format:

signed_payload = `${t}.${raw_body}`

  4. Compute the signature:

signature = HMAC_SHA256(secret, signed_payload)

  5. Compare the computed signature with v1 from the header
Important
The signature must be verified against the raw request body, not against a re-serialized JSON object.
Correct:
  use the original raw request body string

Incorrect:
  use JSON.stringify(req.body) for verification
Even small formatting differences in JSON may cause signature verification to fail.
Recommended replay protection
We recommend validating that the timestamp t is recent, for example within a 5-minute window.
Example rule: 
          
  if the difference between the current server time and t is greater than 300 seconds, the webhook should be rejected
This helps protect against replay attacks using old signed requests.
Node.js verification example
import crypto from "crypto";
    
function verifyWebhook(rawBody, signatureHeader, secret) {
  // signatureHeader example: "t=1710000000,v1=abcdef..."
    
  const parts = Object.fromEntries(
    signatureHeader.split(",").map((item) => item.split("=").map((s) => s.trim()))
  );
    
  const t = parts.t;
  const v1 = parts.v1;
    
  if (!t || !v1) return false;
    
  // Optional replay protection (5-minute window)
  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - Number(t)) > 300) return false;
    
  const signedPayload = `${t}.${rawBody}`;
    
  const expected = crypto
    .createHmac("sha256", secret)
    .update(signedPayload)
    .digest("hex");
    
  if (expected.length !== v1.length) return false;
    
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}
Main payload fields
NameDescription
webhookIdUnique identifier of the webhook event. It should be used for deduplication in case the same webhook is delivered more than once
eventCurrently supported: "transaction.updated"
eventTimestampTimestamp indicating when the event occurred
orderNumberUnique transaction or order identifier used for matching and updating the transaction in your system
dataContains the current transaction state and related details
    typeAn object containing the type of swap (fixed or floating rate)
        typeSwapA type of swap where 1 - Fixed, 2 - Float
    pairsAn object containing information about coin pairs for deposit and withdrawal
        deposit / receiveInformation about the asset the customer sends / receives
            coinAn object containing information about the coin used for deposit or withdrawal
                nameCoin name (eg BTC, XMR)
                valueThe number of coins that will be sent or received
                networkThe blockchain/network in which the transaction takes place (eg ERC20, XMR)
                fullNameThe full name of the coin, if available
            addressDeposit or recipient address
            memoMemo / tag, if applicable
    receiveTransactionInformation about the outgoing receive transaction, if already available
        txIdBlockchain transaction ID
        addressRecipient address
        receivedTimeTime received
        gettingInTheBlockBlock inclusion information
        amountTransferred amount
    swapTimeSwap timing information
        endSwap end time
        durationTotal duration
        startSwap start time
    orderNumberThe unique identifier of the transaction
    statusCurrent transaction status
    txIdTransaction ID, if available
    refundAddressRefund address, if applicable
    receivedTimeDeposit receiving time
    gettingInTheBlockThe time of receiving the first deposit confirmation
    confirmationNumber of confirmations for the transaction for deposit
    createdAtTransaction creation timestamp
timestampTimestamp indicating when the webhook was sent
Payload example
{
  "webhookId": "8d055b5a-0fe8-450c-9a5b-f8318617569d",
  "event": "transaction.updated",
  "eventTimestamp": "2026-03-23T16:07:29.059Z",
  "orderNumber": "OEFRW0",
  "data": {
    "type": {
      "typeSwap": 2
    },
    "pairs": {
      "deposit": {
        "coin": {
          "name": "BTC",
          "value": 0.00047,
          "network": "BTC",
          "fullName": "Bitcoin"
        },
        "address": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
        "memo": ""
      },
      "receive": {
        "coin": {
          "name": "XMR",
          "value": 5.7084594,
          "network": "XMR",
          "fullName": "Monero"
        },
        "address": "87bsQNEnRRe56A6ERMLmwDCanjkoN6Q2eFwCFqi5tLAQcwzvxDj6rxZUAa2rRPqvX8a6fdpoerpxnNSRTPyAFt4zJsDvZcB",
        "memo": ""
      }
    },
    "receiveTransaction": {
      "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
      "address": "49ALvhFRnJm4n1JsBG2fiAcrpPXeGEUvrLCvUjXNr9TqLk74pmj9X7s9aprrzRNNWHUgRrYbmysN7Xs8UJijXumPTjV5WVb",
      "receivedTime": "1781521720369",
      "gettingInTheBlock": "1781521800928",
      "amount": 0.37555349507259705
    },
    "swapTime": {
      "end": "2026-06-15T11:10:00.928Z",
      "duration": "1m",
      "start": "2026-06-15T13:33:20.248Z"
    },
    "orderNumber": "F723NT",
    "status": 4,
    "txId": "a5398b56b451405bbd2804839100e29709e6f79f993b1ba2e466e952ab7940e4",
    "refundAddress": "8Acf2WLBZtdXjKHfw4qQnd48k4KNUfT8G4RvLppLJ7d8DA3noV1dg1vLmB3XkvinBFJHuEiNKxyaJ49vmXVCSGwxRCzJGux",
    "receivedTime": "1781520980314",
    "gettingInTheBlock": "1781520980314",
    "confirmation": 3,
    "createdAt": "2026-06-15T10:38:53.613Z"
  },
  "timestamp": "2026-03-23T16:07:29.060Z"
}
Retry policy
If webhook delivery fails, our system automatically retries the request.
Retries are triggered in cases such as:

  non-2xx HTTP response
  request timeout
  network delivery error
Retry schedule
A total of 7 delivery attempts are made over approximately 35 hours:

  1. immediately
  2. after 1 minute
  3. after 5 minutes
  4. after 30 minutes
  5. after 2 hours
  6. after 8 hours
  7. after 24 hours
Receiver best practices
We recommend the following implementation approach:
          
  1. Verify X-Webhook-Signature on every request
     Do not process any webhook unless signature validation succeeds.

  2. Enforce timestamp freshness
     Recommended window: 5 minutes.

  3. Deduplicate by webhookId
     The same webhook may be delivered more than once due to retries.

  4. Return HTTP 2xx quickly
     After validating and storing or enqueueing the event, return a successful response immediately.

  5. Process business logic asynchronously
     Avoid running long operations directly inside the webhook handler.

  6. Upsert transaction state by orderNumber
     Use idempotent updates so repeated webhook deliveries do not create duplicates or inconsistent state.
Recommended processing flow
Recommended Flow:

  1. Receive the webhook request
  2. Read the raw request body
  3. Verify the X-Webhook-Signature header
  4. Validate timestamp freshness
  5. Check whether webhookId has already been processed
  6. Store or enqueue the payload
  7. Update the transaction state by orderNumber
  8. Return HTTP 200 OK
Expected response from your server
When a webhook is successfully received, your endpoint should return any valid 2xx HTTP status code, for example:

  200 OK or 204 No Content

XML File with Cryptocurrency Exchange Rates

The endpoint returns current cryptocurrency exchange rates in XML format.
GET: https://api.pegasusswap.cx/api/cryptocurrencies.xml
Response Structure:
FieldTypeDescription
ratesXML objectRoot element that contains the list of all available exchange directions
itemXML objectOne cryptocurrency exchange direction. The response can contain multiple <item> elements
fromstringCryptocurrency code that the user sends for exchange
tostringCryptocurrency code that the user receives after the exchange
innumberAmount of the from currency used to calculate the exchange rate
outnumberAmount of the to currency the user receives for the in value
amountnumberAvailable reserve of the to currency. This value shows the availability of the payout currency, but it is not the maximum exchange amount
minamountnumberMinimum exchange amount in the from currency
maxamountnumberMaximum exchange amount in the from currency
The response contains a list of available exchange directions. Each <item> element describes one exchange direction: the currency the user sends, the currency the user receives, the rate, the available reserve, and the minimum and maximum exchange amounts.
Example response:
<rates>
  <item>
    <from>BTC</from>
    <to>ETH</to>
    <in>1</in>
    <out>37.608447240937</out>
    <amount>1408.0692163040635</amount>
    <minamount>0.0016722293375580535</minamount>
    <maxamount>37.44023802108406</maxamount>
  </item>
</rates>

Errors

Amount to swap is below the possible min amount to swap:
This error occurs when the amount to swap is below the possible min amount to swap.
{
  "statusCode": 400,
  "message": "Minimum amount to exchange is 0.1"
}
Amount to swap is higher the possible max amount to swap:
This error occurs when the amount to swap is higher the possible max amount to swap.
{
  "statusCode": 400,
  "message": "Maximum amount to exchange is 10"
}
Invalid withdrawal address:
This error occurs when the specified withdrawal address is invalid or not supported.
{
  "statusCode": 400,
  "message": "Invalid withdrawal address"
}
Errors about incorrectly passed keys:
Errors about incorrectly passed keys or keys not passed will look like this: Example of an error with the id key.
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": [
    "id should not be null or undefined",
    "id must be a string",
    "id should not be empty"
  ]
}
Invalid public key:
This error occurs when an invalid or unknown x-api-public-key is passed in the request headers.
{
  "statusCode": 403,
  "message": "Invalid public key"
}
Invalid payload:
This error occurs when an invalid or unknown x-api-payload is passed in the request headers.
{
  "statusCode": 403,
  "message": "Invalid payload"
}
Invalid signature:
This error indicates that the value provided in the x-api-signature header does not match the expected signature. Refer to the documentation on how to correctly generate the x-api-signature.
{
  "statusCode": 403,
  "message": "Invalid signature"
}
Not found:
This error occurs when the requested data is not found. Please check if the input data is correct.
{
  "statusCode": 404,
  "message": "Not found"
}
Transaction not found or access denied:
This error occurs if the transaction with the specified id does not exist, or if it does not belong to the partner making the request.
{
  "statusCode": 404,
  "message": "Transaction not found or access denied"
}
Invalid Pair:
This error occurs when the selected cryptocurrency pair is unavailable or not supported.
{
  "statusCode": 422,
  "message": "Pair unavailable"
}
You have exceeded your request limit. Please try again later:
This error occurs when the partner key (x-api-public-key) has exceeded the allowed number of requests within a specific time period. Please try again later.
{
  "statusCode": 429,
  "message": "You have exceeded your request limit. Please try again later"
}
Error retrieving coins data:
A server-side error indicating that coin data could not be retrieved.
{
  "statusCode": 500,
  "message": "Error retrieving coins data"
}
Server error:
A general error indicating that something went wrong on the server.
{
  "statusCode": 500,
  "message": "Server error"
}
Unexpected error:
An unspecified server-side error. Please contact support if the issue persists.
{
  "statusCode": 500,
  "message": "Unexpected error"
}
Failed to process the request:
An internal error occurred while processing the request.
{
  "statusCode": 500,
  "message": "Failed to process the request"
}
Failed create transaction:
This error indicates that the server was unable to create a new transaction due to an internal error.
{
  "statusCode": 500,
  "message": "Failed create transaction"
}
Failed to update refund address:
This error indicates that the server was unable to update the refund address due to an internal error.
{
  "statusCode": 500,
  "message": "Failed to update refund address"
}