Skip to main content

Create a swap intent

Creates a new intent with the swap data. A resolver makes an intent offchain and executes it onchain later.

post
/v1/intents/

Request​

Header parameters​

Requires authentication.

Body parameters​

NameTypeRequiredDescription
quote_idStringRequiredYou must resecive quote before swap intent creation.
fromObjectRequiredBase token information for swap intent creation.
from.addressStringOptional requiredPart of the from object. Sender address is not mandatory only for deposit payin types quotes.
from.refund_addressStringRequiredPart of the from object. Address for potential refund.
from.public_keyStringOptionalPart of the from object. Required only if source chain is Bitcoin or Solana.
toObjectRequiredQuote token information for swap intent creation.
to.addressStringRequiredPart of the to object. Receiver address.
Sample request
application/json
{
"quote_id": "e63243b6-c489-42c6-a8a2-739c23bc36a1",
"from": {
"address": "0xbe7A42Af09C2.....C064f5Bd98a88c8EE",
"refund_address": "0xbe7A42Af09C25.....064f5Bd98a88c8EE"
},
"to": {
"address": "B69793d1.....ChkQEr5DZo"
}
}

Response​

Successful response​

NameTypeRequiredDescription
idStringRequiredSwap intent UUID.
expires_atTimestamp (milliseconds)OptionalSwap intent expiration time.
secret_hashStringOptionalValue based on public_key in request.
approval_typeStringRequiredApproval mechanism, depends on network. Possible values: permit2, cosign or htlc.
approve_toString / NullableRequiredApproval address.
params_to_signObjectRequiredObject with data to sign by user's wallet.
quoteObjectRequiredApplied quote for the current swap intent.
depositObjectOptionalDeposit information object for intents based on deposit payin type.
deposit.token_idIntOptional requiredPart of the deposit object. Token deposit.
deposit.addressStringOptional requiredPart of the deposit object. Deposit address.
deposit.memoString / NullableOptional requiredPart of the deposit object. Addtional memo information for deposit identification.
deposit.expires_atTimestamp (milliseconds)Optional requiredPart of the deposit object. Time left for deposit detection.
Sample response (Offchain scenario with EVM and Tron)
application/json
{
"id": "bf53a856-46aa-4865-8d66-a649a9d5b169",
"expires_at": 1780078455,
"secret_hash": "0x3f2bb70a115e0a.....187d9351c565682b8",
"approve_to": null,
"approval_type": "permit2",
"params_to_sign": {
"nonce": 81,
"additional_data": {
"types": {
"DepositWitness": [
{
"name": "resolverDepositAddress",
"type": "address"
},
{
"name": "secretHash",
"type": "bytes32"
},
{
"name": "deadline",
"type": "uint256"
}
],
"TokenPermissions": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"PermitWitnessTransferFrom": [
{
"name": "permitted",
"type": "TokenPermissions"
},
{
"name": "spender",
"type": "address"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "witness",
"type": "DepositWitness"
}
]
},
"domain": {
"name": "Permit2",
"chainId": 1,
"version": "1",
"verifyingContract": "0x000000000022D.....DEE9F6B43aC78BA3"
},
"witness": {
"deadline": "0x6a19d777",
"secretHash": "0x3f2bb70a115e0a.....187d9351c565682b8",
"resolverDepositAddress": "0x745f221ca.....a6649a0c5fc5"
},
"witness_hash": "0xa6b608c2503bb6e6d9.....2a054786dbaf41beed9",
"witness_type_string": "DepositWitness witness)DepositWitness(address resolverDepositAddress,bytes32 secretHash,uint256 deadline)TokenPermissions(address token,uint256 amount)"
},
"escrow_contract_address": "0x8DcbE1aCf3.....e318F8e8836",
"permit2_contract_address": "0x0000000000.....6B43aC78BA3",
"resolver_deposit_address": "0x745F221caec.....A6649a0c5Fc5"
},
"quote": {
"id": "f5a68149-e20c-4774-9494-16d3cee0f84d",
"from": {
"network_id": 3,
"token_id": 278,
"contract_address": "0xdac17f958d2.....97c13d831ec7",
"amount": "1000000",
"decimals": 6
},
"to": {
"network_id": 177,
"token_id": 678,
"contract_address": null,
"amount": "7277684",
"decimals": 9,
"min_amount": "7241295"
},
"slippage_bps": "50",
"expires_at": 1780071289460000,
"payin_type": "offchain",
"fees": {
"affiliate": {
"network_id": 3,
"contract_address": "0xc02aaa39b2.....d9083c756cc2",
"token_id": 4669,
"decimals": 18,
"amount": "2454849184592",
"bps": "50"
}
}
}
}
Sample response (Deposit scenario)
application/json
{
"id": "95274a0b-6a75-4550-89e3-fde79f85de00",
"expires_at": 1790879446,
"secret_hash": "0x9d2e2f6c2c0957a0b0b1486bdab6c5657fa028193f551a6718357e383a09fd9d",
"approve_to": null,
"approval_type": "deposit",
"params_to_sign": {},
"quote": {
"id": "40c94ce2-a39c-4c80-9daa-097eacfe9d2d",
"payin_type": "deposit",
"from": {
"network_id": 3,
"token_id": 1,
"contract_address": "BITCOIN_TOKEN_ADDRESS",
"amount": "10000",
"decimals": 8
},
"to": {
"network_id": 6,
"token_id": 4,
"contract_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"amount": "2931360077847389",
"decimals": 18,
"min_amount": "2902046477068915"
},
"slippage_bps": "100",
"expires_at": 1790835148,
"fees": {
"affiliate": {
"decimals": 18,
"amount": "1552175133491",
"bps": "5",
"network_id": 6,
"contract_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_id": 4669
}
}
},
"deposit": {
"token_id": 1,
"address": "bc1qx****************kfjhx0wlh",
"memo": null,
"expires_at": 1790865946
}
}

Error response​

Check the error response schema.

Error codes​

Error codeError typeError description
400bad_request_errorInvalid body parameters.
401authentication_errorAuthentication error.
404http_errorIncorrect HTTP request.
422unprocessable_entity_errorConfiguration error.
422unprocessable_entity_errorIntent already exists for quote.
422unprocessable_entity_errorIntent could not be processed.
422unprocessable_entity_errorInvalid address.
422unprocessable_entity_errorInvalid amount.
422unprocessable_entity_errorInvalid resolver address.
422unprocessable_entity_errorInvalid signed data.
422unprocessable_entity_errorInvalid value.
422unprocessable_entity_errorInvalid swap status.
422unprocessable_entity_errorNetwork or token could not be processed.
422unprocessable_entity_errorNo valid swap for provided intent.
422unprocessable_entity_errorOnly wrapped tokens can be used as source.
422unprocessable_entity_errorQuote Expired.
422unprocessable_entity_errorQuotes not available.
422unprocessable_entity_errorRequested pair could not be processed.
422unprocessable_entity_errorSlippage must be less than or equal to limit.
422unprocessable_entity_errorSlippage must be greater than or equal to limit.
422unprocessable_entity_errorSlippage value could not be processed.
422unprocessable_entity_errorSwap amount is too large.
422unprocessable_entity_errorSwap amount is too small.
422unprocessable_entity_errorSwap type could not be processed.
422unprocessable_entity_errorSwap type unsupported for requested token.
422unprocessable_entity_errorUnsupported approval type.
429rate_limit_errorRate limit exceeded.
500internal_errorIntent approval failed.
500internal_errorInternal configuration error.
500internal_errorInternal processing error.
500internal_errorInternal server error.
{
"code": 400,
"type": "bad_request_error",
"message": "body.from.QuoteDirectionByTokenId.token_id must be an integer"
}