POST /target-volume/pay
Pay an unpaid order from one of the user's wallets.
Sends what the order's group still lacks to its paymentAddress. One
payment covers every order of the group. Sync — waits for confirmation
and returns the signature. If the payment address already holds
enough, nothing is sent.
Refused when less than a minute is left before the order expires: create a new order instead.
Headers
| Header | Required | Description |
|---|---|---|
Idempotency-Key | no | 8–128 chars of [A-Za-z0-9_-]. A retry with the same key within 24 hours returns the first response (with Idempotent-Replayed: true) instead of paying twice. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
iOrderId | string | yes | _id of any order in the group. |
sWalletAddress | string | yes | Source pubkey; must be user-owned. |
Response 200
{
"message": "Payment sent",
"paymentAddress": "…",
"sFrom": "…",
"nSol": 4.2,
"signature": "3k…"
}
When the payment address already covers the order:
{
"message": "The payment address already covers this order",
"paymentAddress": "…",
"nSol": 0
}
Errors
| Status | Meaning |
|---|---|
400 | Invalid inputs; insufficient balance (response includes nBalanceSol, nRequiredSol); or the wallet would be left below the rent-exempt minimum. |
403 | Target Volume is not available for this account, or the wallet is reserved for Smart Sell. |
404 | No order of this user waiting for payment under iOrderId, or wallet not found / not owned. |
409 | Another payment or cancel for this user is in progress, or the order is about to expire. |
502 | The transfer was not confirmed. Check the order before paying again. |
503 | Balance could not be read; retry later. |
Example
curl -X POST "$BASE_URL/target-volume/pay" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Idempotency-Key: pay-6730-0001" \
-H "Content-Type: application/json" \
-d '{ "iOrderId": "6730…", "sWalletAddress": "…" }'