POST
/
orders
Create a new order
curl --request POST \
  --url https://mainnet.anyspend.com/orders \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "swap",
  "recipientAddress": "0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1",
  "srcChain": 1,
  "dstChain": 8453,
  "srcTokenAddress": "0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234",
  "dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "srcAmount": "1000000",
  "payload": {
    "expectedDstAmount": "990000",
    "actualDstAmount": "990000"
  },
  "metadata": {
    "srcToken": {
      "chainId": 8453,
      "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": 6,
      "metadata": {
        "logoURI": "https://polygonscan.com/token/images/usdc_32.png"
      }
    },
    "dstToken": {
      "chainId": 8453,
      "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": 6,
      "metadata": {
        "logoURI": "https://polygonscan.com/token/images/usdc_32.png"
      }
    }
  },
  "partnerId": "<string>",
  "onramp": {
    "vendor": "coinbase",
    "paymentMethod": "",
    "country": "SG",
    "redirectUrl": "https://www.anyspend.com"
  },
  "creatorAddress": "0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1"
}'
{
  "success": true,
  "message": "Created order successfully",
  "data": {
    "id": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
    "recipientAddress": "0xb34facb90a200251318e8841c05102366f2158cf",
    "globalAddress": "0xa640beaa78eeb64bb269f2baf8202b9a7316e123",
    "srcChain": 8453,
    "dstChain": 8453,
    "srcTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "dstTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "srcAmount": "93354000",
    "status": "executed",
    "errorDetails": "<string>",
    "createdAt": 1752505794679,
    "expiredAt": 1752506694679,
    "creatorAddress": "0xb34facb90a200251318e8841c05102366f2158cf",
    "partnerId": "<string>",
    "onrampMetadata": {
      "country": "US",
      "vendor": "stripe-web2",
      "paymentMethod": "",
      "redirectUrl": "https://www.anyspend.com",
      "stripeAmountInCents": 9900
    },
    "oneClickBuyUrl": "<string>",
    "stripePaymentIntentId": "pi_3Rko0sJnoDg53PsP0PDLsHkR",
    "type": "swap",
    "payload": {
      "expectedDstAmount": "990000",
      "actualDstAmount": "990000"
    },
    "metadata": {
      "srcToken": {
        "chainId": 8453,
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "symbol": "USDC",
        "name": "USD Coin",
        "decimals": 6,
        "metadata": {
          "logoURI": "https://polygonscan.com/token/images/usdc_32.png"
        }
      },
      "dstToken": {
        "chainId": 8453,
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "symbol": "USDC",
        "name": "USD Coin",
        "decimals": 6,
        "metadata": {
          "logoURI": "https://polygonscan.com/token/images/usdc_32.png"
        }
      }
    }
  },
  "statusCode": 200
}

Body

application/json

Swap order request

Response

200
application/json

Order created successfully

The response is of type object.