Create a payment from another chain
const url = 'https://hub.stablezact.com/api/v1/payments/cross-chain/create';const options = { method: 'POST', headers: {'X-Public-Key': '<X-Public-Key>', 'Content-Type': 'application/json'}, body: '{"amount":1,"originChainId":1,"originCurrency":"example","customerEmail":"hello@example.com","callbackUrl":"https://example.com","orderId":"example","metadata":{"additionalProperty":"example"},"expiresIn":1800}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://hub.stablezact.com/api/v1/payments/cross-chain/create \ --header 'Content-Type: application/json' \ --header 'X-Public-Key: <X-Public-Key>' \ --data '{ "amount": 1, "originChainId": 1, "originCurrency": "example", "customerEmail": "hello@example.com", "callbackUrl": "https://example.com", "orderId": "example", "metadata": { "additionalProperty": "example" }, "expiresIn": 1800 }'The customer pays on originChainId and you settle on your own chain,
with the transfer bridged in between.
This endpoint reports failures with a code as well as a message, which
the rest of the API mostly does not. Read the code rather than matching
on the text.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The chain the customer pays from. Must be an EVM chain; anything else is refused with ORIGIN_NOT_SUPPORTED.
The token the customer pays in on the origin chain.
object
Seconds until the payment expires. Thirty minutes by default, which is longer than the fifteen a deposit-address payment gets, because a bridged transfer has more to do. Unlike the deposit window, this one is settable and is honoured to the second.
Responses
Section titled “Responses”Payment created.
object
object
Always pending on creation.
Where the customer sends the origin-chain funds.
Amount in the origin token’s smallest unit.
The same amount, in whole tokens, for display.
What you receive once the bridge completes.
object
Examplegenerated
{ "success": true, "payment": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "status": "example", "relayDepositAddress": "example", "amountToSend": "example", "amountToSendFormatted": "example", "originChainId": 1, "originCurrency": "example", "destination": { "network": "example", "currency": "example", "amount": "example" }, "expiresAt": "2026-04-15T12:00:00Z" }}Rejected, with one of these codes:
ORIGIN_NOT_SUPPORTED: the origin chain is not EVM.ORIGIN_REFUND_NOT_SUPPORTED: we could not refund on that origin chain if we had to, so the payment is refused rather than accepted with no way back.NO_DESTINATION: your account has no settlement destination that works for this route.
object
Short machine-ish reason.
Longer explanation, when there is one.
Example
{ "success": false, "code": "ORIGIN_NOT_SUPPORTED"}Missing or invalid credentials.
object
Short machine-ish reason.
Longer explanation, when there is one.
Example
{ "error": "API credentials required. Use x-public-key header or x-api-key and x-api-secret headers."}The bridge has no route for this origin, destination and amount. Small amounts are the usual cause, since bridges have their own minimums.
object
Short machine-ish reason.
Longer explanation, when there is one.
Example
{ "success": false, "error": "Relay returned no route for this origin -> destination", "code": "NO_ROUTE"}