Skip to main content

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​

HeaderRequiredDescription
Idempotency-Keyno8–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​

FieldTypeRequiredDescription
iOrderIdstringyes_id of any order in the group.
sWalletAddressstringyesSource 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​

StatusMeaning
400Invalid inputs; insufficient balance (response includes nBalanceSol, nRequiredSol); or the wallet would be left below the rent-exempt minimum.
403Target Volume is not available for this account, or the wallet is reserved for Smart Sell.
404No order of this user waiting for payment under iOrderId, or wallet not found / not owned.
409Another payment or cancel for this user is in progress, or the order is about to expire.
502The transfer was not confirmed. Check the order before paying again.
503Balance 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": "…" }'