ReDoc documentation

Partner Swap Service (2.0)

Download OpenAPI specification:Download

getCryptoCurrencies

Return a list of supported currencies.

Responses
200

OK

get/currencies
Response samples
application/json
[
  • {
    },
  • {
    }
]

getPairs

Return a list of supported pairs.

Responses
200

OK

get/pairs
Response samples
application/json
[
  • {
    },
  • {
    }
]

postQuote

Return a quote for a pair and amount.

  • For fixed trade method, the quoteId is returned.
Request
Request Body schema: application/json

Information required for generating the payload.

from
required
string

Currency ID in the partner's system.

to
required
string

Currency ID in the partner's system.

amount
required
string

Or the amountTo, it's the amount that user will spend for the swap. (required only for float quotes)

Responses
200

OK

400

This error indicates a violation of one or more constraints within the partner's system regarding the quote request. It is essential for the partner to specify the breached constraint to facilitate correction of the request. You can express any other constraints in your system by extending the error payload.

404

The pair might be currently unavailable on your end, or you might not recognize one of the currencies. Please add relevant details about the causes.

451

User's IP address or currency is in a restricted region.

post/quote
Request samples
application/json
{
  • "from": "btc",
  • "to": "eth",
  • "amount": "1"
}
Response samples
application/json
{
  • "quoteId": "CC14E626-CF1B-4EDA-AF5E-766FFD5A3457",
  • "amount": "1",
  • "amountTo": "270.864632",
  • "providerFees": "0.0001",
  • "referralFees": "0.0001",
  • "payoutNetworkFees": "0.0002",
  • "tradeMethod": "float",
  • "expiry": "2022-04-04T09:10:51+0000",
  • "minAmountFrom": "1",
  • "maxAmountFrom": "3",
  • "defaultSlippage": "0.1",
  • "minSlippage": "0.1",
  • "maxSlippage": "0.3"
}

postSwapFixed

Generates a secure binary payload for the nano in order to authorize the transaction.

  • For swap with fixed trade method, we send on swap endpoint the quoteId (id generated with the previouse call to /quote ). The partner should retrieve the quote data (amounts…) from this id.
  • The final source of Truth for the user is the binary payload you generate.
Request
Request Body schema: application/json

Info for generating payload

quoteId
required
string

Previously generated quote ID.

refundAddress
required
string

User's refund address, typically the fromAddress.

payoutAddress
required
string

User's payout transaction address.

refundAddressExtraId
string

Field used for blockchains that require a memo (e.g., XRP, XLM).

payoutAddressExtraId
string

Field used for blockchains that require a memo (e.g., XRP, XLM).

currencyFrom
required
string

From currency ID, using the provider's identifiers.

currencyTo
required
string

To currency ID, using the provider's identifiers.

payloadCurrencyFrom
required
string

From currency ID, using Ledger's referential. (representing currency_from in the protobuf payload)

payloadCurrencyTo
required
string

To currency ID, using Ledger's referential. (representing currency_to in the protobuf payload)

nonce
required
string

Value for the device_transaction_id_ng field in the protobuf payload, in hex format of the byte array nonce received by the user.

slippage
string

Value between 0 to 1 (0.1 => 10%). Maximum difference between the quoted amount and the final amount received, as a ratio. If exceeded, user consent is required or a refund is made.

Responses
200

OK

400

Deposit wallet not available.

404

Not found error.

451

When the user's IP address is in a restricted region.

post/swap/fixed
Request samples
application/json
{
  • "quoteId": "string",
  • "refundAddress": "string",
  • "payoutAddress": "string",
  • "refundAddressExtraId": "string",
  • "payoutAddressExtraId": "string",
  • "currencyFrom": "string",
  • "currencyTo": "string",
  • "payloadCurrencyFrom": "string",
  • "payloadCurrencyTo": "string",
  • "nonce": "string",
  • "slippage": "string"
}
Response samples
application/json
{
  • "swapId": "SWAP-ID-165940",
  • "payinAddress": "0xa0b86991c627e936c1d19d4a2e90a2ce3606eb48",
  • "createdAt": "2030-05-26T14:13:39",
  • "providerFees": "0.0001",
  • "referralFees": "0.0001",
  • "payoutNetworkFees": "0.0002",
  • "providerSig": {
    }
}

postSwapFloat

Generates a secure binary payload for the nano in order to authorize the transaction.

  • For swap with floating trade method, we send on swap endpoint the amount. This exact value should be used to generate the swap order and the binary payload, but the amount to might be updated.
  • The final source of Truth for the user is the binary payload you generate.
Request
Request Body schema: application/json

Info for generating payload

amount
required
string

Amount requested by the user to be swap (or amountFrom).

refundAddress
required
string

User's refund address, typically the fromAddress.

payoutAddress
required
string

User's payout transaction address.

refundAddressExtraId
string

Field used for blockchains that require a memo (e.g., XRP, XLM).

payoutAddressExtraId
string

Field used for blockchains that require a memo (e.g., XRP, XLM).

currencyFrom
required
string

From currency ID, using the provider's identifiers.

currencyTo
required
string

To currency ID, using the provider's identifiers.

payloadCurrencyFrom
required
string

From currency ID, using Ledger's referential. (representing currency_from in the protobuf payload)

payloadCurrencyTo
required
string

To currency ID, using Ledger's referential. (representing currency_to in the protobuf payload)

nonce
required
string

Value for the device_transaction_id_ng field in the protobuf payload, in hex format of the byte array nonce received by the user.

slippage
string

Value between 0 to 1 (0.1 => 10%). Maximum difference between the quoted amount and the final amount received, as a ratio. If exceeded, user consent is required or a refund is made.

Responses
200

OK

400

Deposit wallet not available.

451

When the user's IP address is in a restricted region.

post/swap/float
Request samples
application/json
{
  • "amount": "string",
  • "refundAddress": "string",
  • "payoutAddress": "string",
  • "refundAddressExtraId": "string",
  • "payoutAddressExtraId": "string",
  • "currencyFrom": "string",
  • "currencyTo": "string",
  • "payloadCurrencyFrom": "string",
  • "payloadCurrencyTo": "string",
  • "nonce": "string",
  • "slippage": "string"
}
Response samples
application/json
{
  • "swapId": "SWAP-ID-165940",
  • "payinAddress": "0xa0b86991c627e936c1d19d4a2e90a2ce3606eb48",
  • "createdAt": "2030-05-26T14:13:39",
  • "providerFees": "0.0001",
  • "referralFees": "0.0001",
  • "payoutNetworkFees": "0.0002",
  • "providerSig": {
    }
}

getStatus

Returns the status of a quote / trade being executed.

Request
query Parameters
swapId
required
string
Example: swapId=1234
Responses
200

OK

404

Swap transaction not found.

get/status
Response samples
application/json
{
  • "status": "PENDING",
  • "amount": "1.337",
  • "payinTransactionId": "0xfffffffffffff",
  • "payoutTransactionId": "0xfffffffffffff",
  • "providerFees": "0.0001",
  • "referralFees": "0.0001",
  • "payoutNetworkFees": "0.0002"
}