GET /v1/onchain/{orderId}/refund
The refund of an order opened on a Solana escrow, built by the hub as a serialized, unsigned
transaction for the order’s own user, who is its fee payer and its only signer. The user’s wallet
signs it and sends it.
Not scoped to your organization. An EVM refund needs no such route:
refund(order) is one call, built from Get escrow order. A
Solana refund names ten accounts plus three per input, in an order the program defines, so the hub
builds it and the client only signs.
Request
Path parameters
Query parameters
Response
data (OnchainRefund):
Behavior
- Built from the chain when you ask. The hub reads the escrow’s order record, the cluster’s clock and each input’s mint at request time, and simulates the transaction before serving it, so it never hands out one the program would refuse.
- Short-lived. The transaction carries a recent blockhash and lives about a minute: send it
before
lastValidBlockHeight, or ask again. Fetch it right before the user signs. - The cluster’s clock decides. The refund needs the cluster’s clock strictly past
refundableAfter. Before that, the route answersEIN0007NOT_YET_REFUNDABLEwith both values, so you can show when the refund opens. unwrap=truecloses the whole wrapped-SOL account, so wrapped SOL the user already held there becomes SOL too.- Anyone may fetch it. A refund is permissionless on chain and pays only the order’s user, so the transaction needs availability, not confidentiality: the same reasoning as Get escrow order.
- Check before signing:
feePayeris the user’s connected wallet;programis a declared escrow; and the transaction holds only the escrow’srefundfor this order, plus, withunwrap, one SPL TokenCloseAccountthat pays the user. The TypeScript SDK runs these checks (SDK — Refunds).
Errors
The
EIN0007 reasons:
The gateway’s own refusals — a refused credential, a route not open to it, a rate limit, the hub unreachable or too slow — can come back from every route, with an
EPX code and a real HTTP status (Errors — gateway codes); EIN0049 (internal, scrubbed) can come back from any route.
Example
Response
Illustrative values; formats follow the Response table. The program, the transaction, the blockhash and the token account are elided: real ones are not derivable from the documented sources.See also
- SDK:
client.api.getOnchainRefund();client.refundSolanaOrder()fetches, checks, signs and sends the refund (Refunds — Solana-origin orders) - Get escrow order: the EVM refund’s source
- Refunds, Solana support