Skip to main content
POST
/
v1
/
swaps
/
approval
Create a new Approval transaction
curl --request POST \
  --url https://sandbox-api.borderless.xyz/v1/swaps/approval \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fromAccountId": "cm2c4x3cc000019stwv7um4zl",
  "fromAmount": "100.50",
  "fromAsset": "ETH",
  "passphrase": "my-secure-passphrase"
}
'
{
  "id": "<string>",
  "expiredAt": "2023-11-07T05:31:56Z",
  "fromAmountUSD": "<string>",
  "toAmountUSD": "<string>",
  "estimatedCostsUSD": "<string>",
  "steps": [
    {
      "executionDuration": 123,
      "source": {
        "currency": "<string>",
        "chainId": 123,
        "amount": "<string>",
        "amountUSD": "<string>",
        "minAmount": "<string>"
      },
      "destination": {
        "currency": "<string>",
        "chainId": 123,
        "amount": "<string>",
        "amountUSD": "<string>",
        "minAmount": "<string>"
      },
      "estimate": {
        "feeCosts": [
          {
            "amount": "<string>",
            "amountUSD": "<string>",
            "token": "<string>",
            "included": true
          }
        ],
        "gasCosts": [
          {
            "amount": "<string>",
            "amountUSD": "<string>",
            "token": "<string>",
            "included": true
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
fromAccountId
string
required

The id of the account authorized for smart contract interaction.

Required string length: 25
Example:

"cm2c4x3cc000019stwv7um4zl"

fromAmount
string
required

The amount approved for the smart contract interaction.

Example:

"100.50"

fromAsset
enum<string>
required

The token associated with a specific blockchain for smart contract approval.

Available options:
POL,
USDT_POLYGON,
USDC_POLYGON,
USDM_POLYGON,
ETH,
USDT_ETHEREUM,
USDC_ETHEREUM,
USDM_ETHEREUM,
TRX,
USDT_TRON,
ETH_BASE,
USDC_BASE,
USDM_BASE,
ETH_OPTIMISM,
USDT_OPTIMISM,
USDC_OPTIMISM,
USDM_OPTIMISM,
BTC,
CELO,
CUSD_CELO,
USDC_CELO,
SOL,
USDC_SOLANA,
USDT_SOLANA
Example:

"ETH"

passphrase
string

The passphrase for executing the transaction, if required. Learn more at Transaction Signing Documentation.

Example:

"my-secure-passphrase"

Response

Successfully created Approval transaction data.

id
string
required

Temporary quote ID for execution via /swaps/quote/execution.

expiredAt
string<date-time>
required

Quote expiration date.

fromAmountUSD
string
required

Amount in USD for the source asset.

toAmountUSD
string
required

Amount in USD for the destination asset.

estimatedCostsUSD
string
required

Estimated costs in USD.

steps
object[]
required

Steps for the swap.