Submit gasless swap¶
POST /gasless/submit-swap
Execute a gasless quote by submitting the wallet's Permit2 signature. The signature must be 65 bytes hex-encoded with a 0x prefix (132 characters total). The swap is relayed on-chain on the signer's behalf; the response carries a swapId for polling GET /gasless/status and a photonTxId that identifies the relayed transaction in the Photon API. The initial status is always "submitted".
Authentication
Send your API key in the api-key header.
Request body (application/json)
{
"quoteId": "8c6f1d0b8a9e4f2c5d3b7a1908e6c4f2d0b8a6e4c2f0d8b6a4e2c0f8d6b4a2e0",
"signature": "0xa3f8c1d24e5b697081920a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f1b2c3d4e5f60718293a4b5c6d7e8f9021324354657687980919293a4b5c6d7e81c"
}
Responses
| Status | Description |
|---|---|
200 |
The swap was accepted and relayed. |
400 |
The quote is not a gasless quote, or the signature is malformed. Plausible catalog codes behind the numeric status include VALIDATION_001 (invalid input) and AUTH_008 (invalid wallet signature). |
401 |
Missing or invalid API key. Plausible catalog codes behind the numeric status are AUTH_001 (unauthorized access) and AUTH_002 (invalid API key). |
404 |
Quote not found or expired. Plausible catalog code behind the numeric status is RESOURCE_001 (requested resource not found). |
500 |
Unexpected server-side failure. Plausible catalog codes behind the numeric status include SYSTEM_002 (internal server error) and SYSTEM_001 (database operation failed). |
200 response
{
"code": 0,
"message": "success",
"data": {
"swapId": "68fa3491b2e64d0a51c7d904",
"photonTxId": "68fa3450539a3c9d28bbca33",
"status": "submitted",
"fromChain": 8453,
"toChain": 8453,
"fromToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"toToken": "0x4200000000000000000000000000000000000006",
"amountIn": "1000000000",
"amountOut": "398400000000000000",
"feeAmount": "1250000",
"routeKind": "sameChainSwap"
}
}