Skip to main content
Every Gcashier Pay API interaction — whether a payment initiation, a status query, or an FX conversion — uses the same two-layer JSON structure. The outer envelope is what travels over the wire and contains the encrypted payload alongside the keys needed to decrypt it. Inside that envelope, the inner JSON is divided into a head section that carries routing and protocol metadata, and a body section that carries the business-specific fields for each operation. Understanding this structure is essential before working with any individual API endpoint.

Outer Envelope vs Inner JSON

When you POST a request, the body your HTTP client sends looks like this:
After Gcashier Pay decrypts jsonEnc, the revealed inner JSON always follows this shape:

Request Head Fields

The head object in every outgoing request contains the following fields:
Field attribute key used throughout this documentation:
  • M — Mandatory. Always include this field.
  • O — Optional. You may omit it; a sensible default or null applies.
  • C — Conditionally required. Required only when a specific condition is met, as described in each field’s notes.

Response Head Fields

Gcashier Pay adds two additional fields to the head when it returns a response:

Standard Response Codes

Any code other than these two indicates a failure. Refer to the error code reference for a full list.

Full Request Example

The following inner JSON is what you encrypt before sending. This example initiates a payment order (sp1301):

Full Response Example

After Gcashier Pay processes the request, the decrypted inner JSON response looks like this:
A respCode of S00001 means the order was accepted and is being processed. You will receive the final result via a webhook callback to the callbackUrl you provided in the request body.

Using accessToken for Delegated Operations

Certain operations — particularly FX trading — require an accessToken in the request head. The token identifies the sub-account or delegated authority under which the operation is performed. Obtain the token through the authentication flow before calling these endpoints.
If an endpoint requires accessToken, its reference page will list the field with attribute C and describe exactly when it is required. Always check the individual endpoint documentation.