Skip to main content

Create а quote

Retrieves the best available swap quote for a given source token, destination token, payin scenario and amount. Also, returns pricing details, limits, and metadata required to proceed with a swap. Quotes has time limits and must be executed before their expiration.

post
/v1/quotes/

Request​

Header parameters​

Requires authentication.

Body parameters​

NameTypeRequiredDescription
fromObjectRequiredBase token information to receive a quote.
from.token_idNumberConditional requiredPart of the from object. Required only if network_id and token are not provided. To receive token_id, use the GET /v1/tokens endpoint.
from.network_idNumberConditional requiredPart of the from object. Required only if token_id is not provided. To receive network_id, use the GET /v1/networks endpoint.
from.contract_addressStringConditional requiredPart of the from object. Required only if token_id is not provided.
from.decimalsNumberConditional requiredPart of the from object. Required only if token_id is not provided.
toObjectRequiredQuote token information for receiving quote.
to.token_idNumberConditional requiredPart of the to object. Required only if network_id and token are not provided. To receive token_id, use the GET /v1/tokens endpoint.
to.network_idNumberConditional requiredPart of the to object. Required only if token_id is not provided. To receive network_id, use the GET /v1/networks endpoint.
to.contract_addressStringConditional requiredPart of the to object. Required only if token_id is not provided.
amountDecimals in stringRequiredAmount to swap.
slippage_bpsStringOptionalSlippage expressed in basis points. Value must be from 100 to 10000 bps.
payin_typesArray of stringOptionalOne or many of offchain, onchain, deposit. The transaction signing flow types: onchain, offchain (via offchain intent), or a deposit scenario where the swap initiates after receiving crypto funds at a unique deposit address.
feesObjectOptionalApplied custom partner fees for current quote.
fees.affiliateObjectOptionalPart of the fees object. Affiliate fee information.
fees.affiliate.token_idNumberOptionalPart of the fees.affiliate object. Unique identifier of the token in which the affiliate fee is collected. To receive token_id, use the GET /v1/tokens endpoint.
fees.affiliate.feeDecimal in stringOptionalPart of the fees.affiliate object. The custom affiliate fee value, specified in basis points (e.g., "100" = 1%).
info

The fees.affiliate.fee value in basis points must be in increments of 5 (or 0.05%) and cannot exceed 3% (300 bps).

Sample request for deposit scenario
application/json
{
"from": {
"token_id": 278
},
"to": {
"token_id": 4
},
"amount": "100000000",
"slippage_bps": "100",
"payin_types": ["deposit"],
"fees": {
"affiliate": {
"token_id": 4669,
"fee": "100"
}
}
}

Response​

Successful response​

NameTypeRequiredDescription
idNumberRequiredQuote id.
fromObjectRequiredBase token information to receive a quote.
from.network_idNumberOptionalPart of the from object.
from.contract_addressStringOptionalPart of the from object.
from.token_idNumberOptionalPart of the from object.
from.addressStringOptionalPart of the from object. Sender address.
from.amountDecimals in stringRequiredPart of the from object. Amount to swap.
from.decimalsNumberRequiredPart of the from object.
toObjectRequiredQuote token information for receiving quote.
to.network_idNumberOptionalPart of the to object.
to.contract_addressStringOptionalPart of the to object.
to.token_idNumberOptionalPart of the to object.
to.min_amountDecimals in stringRequiredPart of the to object. Minimal quote amount expressed in basis points.
to.amountDecimals in stringRequiredPart of the to object. Maximum quote amount expressed in basis points.
to.decimalsNumberOptionalPart of the to object.
slippage_bpsStringOptionalSlippage expressed in basis points.
expires_atTimestampOptionalQuote expiration time. After this timestamp, the quote is no longer valid and must be refreshed. Quotes should always be executed before expiry to guarantee pricing.
feesObjectRequiredApplied fees for current quote.
fees.affiliateObjectOptionalPart of the fees object. Affiliate fee information.
fees.affiliate.network_idNumberOptionalPart of the fees.affiliate object. Network relation.
fees.affiliate.contract_addressStringOptionalPart of the fees.affiliate object. Affiliate token contract address.
fees.affiliate.token_idNumberOptionalPart of the fees.affiliate object. Affiliate token ID.
fees.affiliate.decimalsNumberOptionalPart of the fees.affiliate object. Affiliate token decimals to adjust amount.
fees.affiliate.amountDecimals in stringOptionalPart of the fees.affiliate object. Affiliate fee amount.
fees.affiliate.bpsStringOptionalPart of the fees.affiliate object. Affiliate amount of basis points.
payin_typeStringOptionalOne applied for the quote transaction signing flow type: onchain, offchain (via offchain intent), or a deposit scenario.
approval_typeStringOptionalThe approval mechanism required for the intent for offchain payin type value. Supported values: htlc, cosign, or permit2.
approve_toStringOptionalAddress of the smart contract to which token allowance must be granted before executing the swap.
requires_wrapBoolOptionalIndicates whether the source native token must be wrapped before initiating the swap or intent execution.
Sample response for offchain scenario
application/json
{
"id": "7573f623-d4e8-484c-8119-693161bf51f6",
"from": {
"network_id": 3,
"token_id": 278,
"contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"amount": "100000000",
"decimals": 6
},
"to": {
"network_id": 3,
"token_id": 4,
"contract_address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"amount": "51520895861721835",
"decimals": 18,
"min_amount": "51005686903104616"
},
"slippage_bps": "100",
"expires_at": 1786077376,
"fees": {
"affiliate": {
"decimals": 18,
"amount": "526200855939373",
"bps": "100",
"network_id": 3,
"contract_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_id": 4669
}
},
"payin_type": "offchain",
"approval_type": "htlc",
"approve_to": null,
"requires_wrap": true
}
Sample response for deposit scenario
application/json
{
"id": "7573f623-d4e8-484c-8119-693161bf51f6",
"from": {
"network_id": 3,
"token_id": 278,
"contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"amount": "100000000",
"decimals": 6
},
"to": {
"network_id": 3,
"token_id": 4,
"contract_address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"amount": "51520895861721835",
"decimals": 18,
"min_amount": "51005686903104616"
},
"slippage_bps": "100",
"expires_at": 1786077376,
"fees": {
"affiliate": {
"decimals": 18,
"amount": "526200855939373",
"bps": "100",
"network_id": 3,
"contract_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_id": 4669
}
},
"payin_type": "deposit",
"approval_type": null,
"approve_to": null,
"requires_wrap": true
}

Error response​

Check the error response schema.

Error codes​

Error codeError typeError description
400bad_request_errorInvalid body parameters.
400unprocessable_entity_errorSlippage value cannot be processed.
401authentication_errorAuthentication error.
404http_errorIncorrect HTTP request.
422unprocessable_entity_errorConfiguration error.
422unprocessable_entity_errorInvalid amount.
422unprocessable_entity_errorInvalid fee step value.
422unprocessable_entity_errorInvalid fee value.
422unprocessable_entity_errorNetwork does not exist.
422unprocessable_entity_errorNetwork or token could not be processed.
422unprocessable_entity_errorOnly wrapped tokens can be used as source.
422unprocessable_entity_errorQuotes not available.
422unprocessable_entity_errorRequested pair could not be processed.
422unprocessable_entity_errorSwap amount is too large.
422unprocessable_entity_errorSwap amount is too small.
422unprocessable_entity_errorToken does not exist.
500internal_errorInternal configuration error.
Sample error response with the unprocessable_entity_error type
{
"code": 400,
"type": "creation_error",
"message": "Slippage value cannot be processed"
}
Sample error response with the bad_request_error type
{
"code": 400,
"type": "bad_request_error",
"message": "body.from.QuoteDirectionByTokenId.token_id must be an integer"
}