All FX API calls require a valid
accessToken in the request header, obtained after merchant onboarding is approved. Include it as: Authorization: Bearer <accessToken>.Overview
1
Query supported currency pairs (sp2202)
Discover which sell/buy currency combinations are available for your account.
2
Request an FX quote (sp1201)
Lock in a rate for a specific amount and direction.
3
Execute the FX trade (sp1202)
Confirm the trade using the
quoteId before it expires.4
Receive the FX result webhook (sp3201)
Gcashier Pay posts the final settlement status to your callback URL.
5
Query FX history (sp2201)
Look up past transactions by quoteId or time range.
Step 1 — Query Supported Currency Pairs
Before requesting a quote, call POST /api/sp2202 to retrieve the currency pairs available on your account. This list can change as new corridors are activated, so query it dynamically rather than hard-coding pairs.data represents a tradeable pair. sellCurrency is the currency you spend; buyCurrency is the currency you receive.
Step 2 — Request an FX Quote
Call POST /api/sp1201 to obtain a rate-locked quote. You specify either the sell amount or the buy amount — setlockDirection accordingly.
Request / Response Example — Selling USD, Buying CNY
Step 3 — Execute the FX Trade
Once you have a validquoteId, confirm the trade by calling POST /api/sp1202. Pass the quoteId and your webhook URL for async result delivery.
Step 4 — Receive the FX Result Webhook (sp3201)
Gcashier Pay posts the settlement outcome to yourcallbackUrl after the exchange is processed. Respond with HTTP 200 to acknowledge receipt.
Step 5 — Query FX History
Use POST /api/sp2201 to look up past FX transactions. You can search byquoteId for a specific trade, or by a time range to retrieve all trades within a window.
Time range queries are limited to a maximum window of 24 hours. For historical reporting over longer periods, paginate by shifting the 24-hour window back in increments.
Sandbox Testing
In the Gcashier Pay sandbox environment, the settlement outcome of an FX trade is determined by the last digit of theamount in your sp1201 quote request:
For example, requesting a
sellAmount of 10000.00 (last digit 0) will trigger a successful settlement webhook in the sandbox.