Instant Swap API
Basic Info
All requests should use the domain:
API URL:https://api.pegasusswap.cxProtocol: 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 | |
|---|---|
| Accept | application/json |
| Content-Type | application/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 Endpoint | Payload |
|---|---|
| /api/private/get-all-coins | get-all-coins |
| /api/private/get-coin-network | get-coin-network |
| /api/private/exchange-coin | exchange-coin |
| /api/private/get-transaction | get-transaction |
| /api/private/create-transaction | create-transaction |
Available Currencies List
This API endpoint provides a paginated list of all available currencies.
GET:https://api.pegasusswap.cx/api/private/get-all-coinsParameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| page | number | optional | Current page |
| limit | number | optional | Limit per page |
| search | string | optional | Search by currency name |
| method | number | optional | Method 1 we get an array with coins for deposit. Method 2 we get an array with coins for output |
| depositCoin | string | optional | Deposit coin |
| receiveCoin | string | optional | Receive coin |
| depositNetwork | string | optional | Deposit network |
| receiveNetwork | string | optional | Receive network |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| pagination: | object | Pagination |
| pageCount | number | Page count |
| totalCount | number | Total items |
| depositCoins / withdrawCoins | array | List with coins |
| image | string | Coin image |
| subName | string | Coin sub name |
| name | string | Coin name |
| networks | object | Coin networks |
| deposits / withdraws | array | Deposits or withdraws networks |
| subName | string | Network name |
| memoNeeded | boolean | Network has extra ID |
Example request:
GET:https://api.pegasusswap.cx/api/private/get-all-coins?page=1&limit=5&method=1Example 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-networkParameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| coin | string | required | Currency code (Coin sub name) |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| deposit | array | List with deposit networks |
| withdraws | array | List with withdraws networks |
| subName | string | Sub name network |
Example request:
GET:https://api.pegasusswap.cx/api/private/get-coin-network?coin=ethExample 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-coinParameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| amount | string | required | Amount of currency you are going to send or get |
| coinFrom | string | required | Currency to swap from |
| coinTo | string | required | Currency to swap to |
| networkFrom | string | optional | Network to swap from |
| networkTo | string | optional | Network to swap to |
| lastSource | string | required | We transfer the last input where the data is entered, to the deposit input or the receive input ( for example deposit or receive) |
| typeSwap | string | required | 1 - fixed 2 -float |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| pair | string | Swap pair |
| amount | number | Amount sent |
| exchangeRate | number | Swap rate |
| receive | number | Amount you will receive |
| minAmount | number | Min deposit |
| maxAmount | number | Max deposit |
Example request:
GET:https://api.pegasusswap.cx/api/private/exchange-coin?amount=10&coinFrom=eth&coinTo=usdt&lastSource=deposit&typeSwap=1Example 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-transactionParameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| id | string | required | Swap ID |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| type | object | An object containing the type of swap (fixed or floating rate) |
| typeSwap | number | A type of swap where 1 - Fixed, 2 - Float |
| pairs | object | An object containing information about coin pairs for deposit and withdrawal |
| deposit/receive | object | An object containing information about a coin for deposit and withdrawal |
| coin | object | An object containing information out of a coin for deposit and withdrawal |
| name | string | Coin name (eg BTC, XMR) |
| value | number | The number of coins that will be sent or received |
| network | string | The network in which the transaction takes place (eg ERC20, XMR) |
| fullName | string | The full name of the coin |
| address | string | Address to send or receive coins |
| memo | string | Memo for transaction |
| receiveTransaction | object | An object containing information about the received transaction |
| txId | string | Receive transaction id |
| address | string | Address to receive coins |
| receivedTime | string | The time the transaction was received |
| gettingInTheBlock | string | The time of receiving the first sending confirmation |
| amount | number | null | Number of coins sending |
| swapTime | object | An object containing the swap time |
| end | string | Transaction completion time |
| duration | string | Duration of the transaction |
| start | string | Transaction start time |
| orderNumber | string | The unique identifier of the transaction |
| status | number | New - 9; Confirmation - 1; Exchanging - 3; Success - 4; Sending - 12; Overdue - 5; Error - 6; Pause - 10; Stuck - 11; Refund - 13 |
| txId | string | Deposit transaction id |
| refundAddress | string | Address used to refund the deposit if the swap fails |
| receivedTime | string | Deposit receiving time |
| gettingInTheBlock | string | The time of receiving the first deposit confirmation |
| confirmation | number | null | Number of confirmations for the transaction for deposit |
| createdAt | string | Transaction creation time |
Example request:
GET:https://api.pegasusswap.cx/api/private/get-transaction?id=RTGTLNExample 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-transactionsParameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| page | number | optional | Page number to retrieve. Defaults to 1 |
| limit | number | optional | Number of swaps per page. Defaults to 20, maximum 100 |
| dateFrom | string | optional | Filters transactions created on or after the specified date |
| dateTo | string | optional | Filters 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:
| Name | Type | Description |
|---|---|---|
| pagination | object | An object containing pagination information |
| pageCount | number | Total number of pages available |
| totalCount | number | Total number of swaps for the partner |
| transactions | array | An array of swap objects (see fields below) |
Swap object fields:
| Name | Type | Description |
|---|---|---|
| type | object | An object containing the type of swap (fixed or floating rate) |
| typeSwap | number | A type of swap where 1 - Fixed, 2 - Float |
| pairs | object | An object containing information about coin pairs for deposit and withdrawal |
| deposit/receive | object | An object containing information about a coin for deposit and withdrawal |
| coin | object | An object containing information out of a coin for deposit and withdrawal |
| name | string | Coin name (eg BTC, XMR) |
| value | number | The number of coins that will be sent or received |
| network | string | The network in which the transaction takes place (eg ERC20, XMR) |
| fullName | string | The full name of the coin |
| address | string | Address to send or receive coins |
| memo | string | Memo for transaction |
| receiveTransaction | object | An object containing information about the received transaction |
| txId | string | Receive transaction id |
| address | string | Address to receive coins |
| receivedTime | string | The time the transaction was received |
| gettingInTheBlock | string | The time of receiving the first sending confirmation |
| amount | number | null | Number of coins sending |
| swapTime | object | An object containing the swap time |
| end | string | Transaction completion time |
| duration | string | Duration of the transaction |
| start | string | Transaction start time |
| orderNumber | string | The unique identifier of the transaction |
| status | number | New - 9; Confirmation - 1; Exchanging - 3; Success - 4; Sending - 12; Overdue - 5; Error - 6; Pause - 10; Stuck - 11; Refund - 13 |
| txId | string | Deposit transaction id |
| refundAddress | string | Address used to refund the deposit if the swap fails |
| refundMemo | string | Memo or destination tag for the refund address, when required by the selected currency or network |
| receivedTime | string | Deposit receiving time |
| gettingInTheBlock | string | The time of receiving the first deposit confirmation |
| confirmation | number | null | Number of confirmations for the transaction for deposit |
| createdAt | string | Transaction 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.346ZExample 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-transactionParameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| depositCoin | string | required | Coin from deposit |
| depositAmount | number | required | Amount from deposit |
| depositNetwork | string | required | Address from deposit |
| receiveAddress | string | required | Address from receive |
| receiveCoin | string | required | Coin from receive |
| receiveNetwork | string | required | Network from receive |
| typeSwap | number | required | 1 - fixed, 2 -float |
| refundAddress | string | optional | Refund address |
| refundMemo | string | optional | Memo or destination tag to be used if a refund is required |
| memo | string | optional | If needed memo |
| lastSource | string | required | Deposit or receive |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| type | object | An object containing the type of swap (fixed or floating rate) |
| typeSwap | number | A type of swap where 1 - Fixed, 2 - Float |
| pairs | object | An object containing information about coin pairs for deposit and withdrawal |
| deposit/receive | object | An object containing information about a coin for deposit and withdrawal |
| coin | object | An object containing information out of a coin for deposit and withdrawal |
| name | string | Coin name (eg BTC, XMR) |
| value | number | The number of coins that will be sent or received |
| network | string | The network in which the transaction takes place (eg ERC20, XMR) |
| fullName | string | The full name of the coin |
| address | string | Address to send or receive coins |
| memo | string | Memo for transaction |
| receiveTransaction | object | An object containing information about the received transaction |
| txId | string | Receive transaction id |
| address | string | Address to receive coins |
| receivedTime | string | The time the transaction was received |
| gettingInTheBlock | string | The time of receiving the first sending confirmation |
| amount | number | null | Number of coins sending |
| swapTime | object | An object containing the swap time |
| end | string | Transaction completion time |
| duration | string | Duration of the transaction |
| start | string | Transaction start time |
| orderNumber | string | The unique identifier of the transaction |
| status | number | New - 9; Confirmation - 1; Exchanging - 3; Success - 4; Sending - 12; Overdue - 5; Error - 6; Pause - 10; Stuck - 11; Refund - 13 |
| txId | string | Deposit transaction id |
| refundMemo | string | Memo or destination tag for the refund address, when required by the selected currency or network |
| receivedTime | string | Deposit receiving time |
| gettingInTheBlock | string | The time of receiving the first deposit confirmation |
| confirmation | number | null | Number of confirmations for the transaction for deposit |
| createdAt | string | Transaction creation time |
Example request:
POST:https://api.pegasusswap.cx/api/private/create-transactionExample 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-addressRequest Body Parameters:
| Name | Type | Required or optional | Description |
|---|---|---|---|
| id | string | required | The unique identifier (orderNumber) of the transaction to update |
| refundAddress | string | required | The new refund address to be set for the specified transaction |
| refundMemo | string | optional | Memo or destination tag for the refund address, when required by the selected currency or network |
Successful response fields:
| Name | Type | Description |
|---|---|---|
| message | string | A confirmation message indicating success |
| orderNumber | string | The unique identifier of the updated transaction |
| newRefundAddress | string | The refund address that was successfully set |
| newRefundMemo | string | Updated 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.updatedThis 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 requestWebhook 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 headerImportant
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 verificationEven 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 rejectedThis 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
| Name | Description |
|---|---|
| webhookId | Unique identifier of the webhook event. It should be used for deduplication in case the same webhook is delivered more than once |
| event | Currently supported: "transaction.updated" |
| eventTimestamp | Timestamp indicating when the event occurred |
| orderNumber | Unique transaction or order identifier used for matching and updating the transaction in your system |
| data | Contains the current transaction state and related details |
| type | An object containing the type of swap (fixed or floating rate) |
| typeSwap | A type of swap where 1 - Fixed, 2 - Float |
| pairs | An object containing information about coin pairs for deposit and withdrawal |
| deposit / receive | Information about the asset the customer sends / receives |
| coin | An object containing information about the coin used for deposit or withdrawal |
| name | Coin name (eg BTC, XMR) |
| value | The number of coins that will be sent or received |
| network | The blockchain/network in which the transaction takes place (eg ERC20, XMR) |
| fullName | The full name of the coin, if available |
| address | Deposit or recipient address |
| memo | Memo / tag, if applicable |
| receiveTransaction | Information about the outgoing receive transaction, if already available |
| txId | Blockchain transaction ID |
| address | Recipient address |
| receivedTime | Time received |
| gettingInTheBlock | Block inclusion information |
| amount | Transferred amount |
| swapTime | Swap timing information |
| end | Swap end time |
| duration | Total duration |
| start | Swap start time |
| orderNumber | The unique identifier of the transaction |
| status | Current transaction status |
| txId | Transaction ID, if available |
| refundAddress | Refund address, if applicable |
| receivedTime | Deposit receiving time |
| gettingInTheBlock | The time of receiving the first deposit confirmation |
| confirmation | Number of confirmations for the transaction for deposit |
| createdAt | Transaction creation timestamp |
| timestamp | Timestamp 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 errorRetry 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 hoursReceiver 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 OKExpected 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 ContentXML File with Cryptocurrency Exchange Rates
The endpoint returns current cryptocurrency exchange rates in XML format.
GET: https://api.pegasusswap.cx/api/cryptocurrencies.xmlResponse Structure:
| Field | Type | Description |
|---|---|---|
| rates | XML object | Root element that contains the list of all available exchange directions |
| item | XML object | One cryptocurrency exchange direction. The response can contain multiple <item> elements |
| from | string | Cryptocurrency code that the user sends for exchange |
| to | string | Cryptocurrency code that the user receives after the exchange |
| in | number | Amount of the from currency used to calculate the exchange rate |
| out | number | Amount of the to currency the user receives for the in value |
| amount | number | Available reserve of the to currency. This value shows the availability of the payout currency, but it is not the maximum exchange amount |
| minamount | number | Minimum exchange amount in the from currency |
| maxamount | number | Maximum 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"
}