Endpoints
Create an order
Returns an unsigned transaction, base64-encoded: v1 by default, v0 if you send "txVersion": 0. Have your user sign the bytes and submit them. No other user signature is required.
POST/cloak/v1/order
Examples in
Body
| Field | Description | |
|---|---|---|
| quoteobject | required | The complete, unchanged quote object from POST /quote. |
| senderAddressstring | required | Must match the quote. |
| recipientAddressstring | required | Must match the quote. |
| feeBpsinteger | conditional | Must match the quote. |
| feeRecipientAddressstring | conditional | Required when feeBps > 0. |
| txVersion0 | 1 | optional | Transaction version to build. Omit (or send 1) for v1; send 0 for v0 with an address lookup table if your signer cannot handle v1. Must be a JSON number: "1" is rejected with INVALID_TX_VERSION. Remembered for refreshes. |
Headers
| Header | Description | |
|---|---|---|
| X-Idempotency-Keystring | optional | Strongly recommended. Without one we fall back to the quoteId. See Idempotency. |
Request
Request
curl -sS -X POST "https://api.veilo.network/cloak/v1/order" \
-H "Authorization: Bearer $VEILO_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: $(uuidgen)" \
-d "{
\"quote\": $QUOTE_OBJECT,
\"senderAddress\": \"SENDER_SOLANA_ADDRESS\",
\"recipientAddress\": \"RECIPIENT_SOLANA_ADDRESS\",
\"feeBps\": 50,
\"feeRecipientAddress\": \"PARTNER_FEE_WALLET_ADDRESS\"
}"
# Signer cannot handle v1 (e.g. @solana/web3.js 1.x)? Add "txVersion": 0 to the body.Response
200 · application/json
{
"success": true,
"order": {
"trackingId": "TRACKING_ID",
"transaction": "<base64>", // UNSIGNED transaction
"transactionVersion": 1, // what was built: 1 (default) or 0
"transactionEncoding": "base64",
"amountIn": "10091009518",
"amountOut": "10000000000",
"sourceSymbol": "USDC",
"destinationSymbol": "USDC",
"eta": 300,
"expiration": "2026-08-26T11:52:27.000Z",
"blockhashExpiresAtSlot": 123456789
}
}transactionVersion is authoritative
A v1 request falls back to v0 if Cloak cannot build v1. Branch on transactionVersion in the response, never on the txVersion you sent. See Signing the transaction.
Order and transaction expiry are different
expiration is the order's deadline, tens of minutes, enforced on-chain. The transaction can expire sooner, usually in 60 to 90 seconds.
If submission fails on an expired blockhash, call refresh rather than re-quoting.
Next: sign and submit the transaction, then poll the status.
