Endpoints
Refresh a transaction
Get a new transaction when the original expires before the user signs or submits it.
GET/cloak/v1/order/:trackingId/transaction
Examples in
Returns the same shape as order creation with a fresh blockhash. Works only while the order is PENDING; anything later returns 409 ORDER_NOT_REFRESHABLE.
Query
| Parameter | Description | |
|---|---|---|
| txVersion0 | 1 | optional | Overrides the version the order was created with. Omitted, the refresh reuses the order's txVersion; orders created before v1 became the default rebuild as v1, so pass ?txVersion=0 if you still need v0. Any other value returns 400 INVALID_TX_VERSION. Check transactionVersion in the response. |
Request
Request
curl -sS "https://api.veilo.network/cloak/v1/order/TRACKING_ID/transaction" \
-H "Authorization: Bearer $VEILO_KEY"
# Still need v0 (e.g. a web3.js 1.x signer)? Ask for it explicitly:
curl -sS "https://api.veilo.network/cloak/v1/order/TRACKING_ID/transaction?txVersion=0" \
-H "Authorization: Bearer $VEILO_KEY"Check the version again after a refresh
Without ?txVersion, a refresh reuses the version the order was created with, but orders created before v1 became the default rebuild as v1, and a v1 build can fall back to v0. Sign whatever transactionVersion says you received.
Refreshing cannot double-spend
Refreshed transactions represent the same deposit. If the user submits two versions, only one can succeed.
When to refresh, and when to re-quote
Refresh while the order is still PENDING and the quote has not expired. It keeps the same trackingId, the same terms and the same revenue share. Re-quote only when the order itself has expired.
