Quick start
Make your first API call in three steps:Credentials
IP allowlists
Exchange and confirm both parties’ public egress IPs before integration testing, separately for UAT and PRD. Do not use private IPs or gateway ingress IPs resolved from DNS. IP allowlisting does not replace authentication or signature verification.
Environments
Authentication & Signing
Accessing OristaPay Open APIs requires dual authentication:- OAuth2 Access Token — proves the caller’s identity
- Request signature — protocol v2 (Ed25519) — proves the request was signed by your private key and has not been tampered with
Every request must pass both checks; otherwise it is rejected.
Signature protocol v1 (HMAC-SHA256) remains supported and is scheduled to reach EOL on 2027-01-31 at 24:00 (UTC+8) for API requests and JSON callbacks. Use signature protocol v2 (Ed25519) for new integrations.
X-Signature-Version.
1. Obtain Access Token
Standard OAuth2client_credentials flow (UAT example below).
Request (URL-encode form parameter values)
access_tokencan be reused withinexpires_inseconds. Cache it and refresh proactively 30 seconds before expiry.access_tokenmust be issued by the OAuth client corresponding toX-Api-Key.
2. Signature protocol v2 (Ed25519)
Generate your own Ed25519 key pair. Provide only the public key to OristaPay and keep the private key secure.
Generate the key pair using OpenSSL:
String to Sign
Join the following fields with LF (\n), encode as UTF-8, and do not add a trailing newline:
Signature Calculation
=. Sign and send the same body bytes; preserve query order and percent-encoding. Do not decode the URL, re-serialize JSON, or reuse a signature after a redirect.
Field Definitions
Reference Implementations
- Python
- Java
- Node.js
- Go
ed25519_example.py
V2 request headers
API requests do not use
X-Signature-Key-Id. Re-sign every retry with a fresh timestamp and nonce; v2 nonces are retained for 11 minutes. Keep the business idempotency key unchanged.
3. Callback signature verification
For JSON callbacks, verify the platform’s signature over the entire{bizType, data} envelope with its public key. OAuth tokens are not required. Business events and payloads are described in the relevant API’s Callback section.
Retrieve and cache the platform JWKS
kid identifies a platform signing public key; it is not the public key itself. The platform sends this identifier in the callback’s X-Signature-Key-Id header; its value in this example is example-callback-key. Find the object in the JWKS keys array whose kid exactly matches this header. That object’s decoded x is the verification public key. Put the header’s kid string in the verification payload, not x or the public-key contents.
OristaPay periodically rotates callback signing keys and their kid values. Cache JWKS per environment using Cache-Control and ETag, and validate the JWK fields above.
An unknown kid or failed verification may indicate an expired local key cache or key rotation. Refresh /public/callback/keys with rate limiting, then retry verification once using the same kid. Reject if verification still fails, the key is missing, or refresh fails. Never try a different kid, accept a callback-supplied key URL, or fall back to HMAC.
V2 callback headers and payload
The callback URL is the public HTTPS address you provide to OristaPay to receive callbacks. OristaPay sends a POST to that address; this example useshttps://merchant.example.com/webhooks/order-status. The order notification below uses synthetic values and abbreviated business fields. For a real callback, use the complete body you receive.
callback-example.http
target from that same callback URL that OristaPay POSTs to: remove the scheme, host and port, keeping the path starting with /. If query parameters are present, also keep the ? separator and the original query after it. This is also the part between POST and HTTP/1.1 in the external HTTP request line above.
If the callback URL you provide includes query parameters, for example:
callback-target-example.txt
example-client-id and example-callback-key are demonstration values from the two headers above; do not hardcode these example strings in your integration.
For the complete POST example above without query parameters, the body is one line of UTF-8 JSON, 133 bytes with no trailing newline. Its SHA-256 is the last line below. Joining the nine lines with LF (
\n) gives this exact verification payload:
callback-example-payload.txt
kid from the example JWKS above, decode X-Signature, and verify it against these bytes. The signature is valid; the customer verifies the received signature rather than generating a new one.
Details that affect verification
- Hash the raw body before parsing JSON. Do not parse and re-serialize it, change field order, remove empty fields, trim whitespace, or add a newline. Each changes the signed bytes. Pass the raw byte array to the verification function.
- Use the original external
target. Include the leading/, path and raw query, without scheme or host. Preserve path case, a trailing/, query order and duplicate parameters. Do not decode%2Fto/or+to a space. If a reverse proxy rewrites the internal URL, preserve the original external path/query. The exampletargetis/webhooks/order-status. - Keep every payload value and line exact. Use
CALLBACKand includekid. Copy the received timestamp and nonce unchanged; do not generate replacements or convert milliseconds to seconds or a date string. Use LF, not CRLF, with no indentation or newline after the final hash.X-Signature-Versionselects protocol v2 but is not an extra payload line. - Use the specified encodings. The body hash is lowercase hex.
X-Signatureis unpadded Base64URL: 86 characters decoding to 64 bytes. JWKxdecodes to a 32-byte Ed25519 public key. Use Ed25519 directly on the payload bytes, not Ed25519ph or an extra hash of the payload. HTTP header names are case-insensitive; preserve their values. - Use the platform key for the correct environment and
kid. The public key used to verify callbacks comes from the platform JWKS, separately from your API request-signing key. - Separate signature checks from freshness checks. This is a fixed historical example. For an offline replay of the complete sample function, set the test clock to its timestamp. Live receivers must retain the ±5-minute check and replay protection; an old callback can have a valid signature and still be rejected as expired.
Verification and acknowledgement
- Reject missing or duplicate signature headers. Check version
2, expected client ID, and timestamp (±5 minutes). - Select the platform key by
kidand verify against the raw body bytes, before parsing JSON. - After verification, atomically store
(client_id, nonce)for at least 11 minutes to prevent replay. Reject if verification or replay storage fails. - Apply business idempotency using a stable event key. Nonce is not an idempotency key: retries receive a new signature and nonce.
- Return HTTP
2xxpromptly after durable acceptance. Only HTTP status acknowledges delivery;429,5xxand network failures are retried, other4xxare not.
Notification type and business reference
The JSON body is an envelope with two fields:
After verifying the complete raw body and applying replay protection, parse the envelope, require a string
bizType and object data, then dispatch by the exact bizType value. Do not dispatch by kid, nonce, an order status or guessed body shapes. The callback types documented in the Digital Wallet and ISV APIs are:
For orders, match
data.orderNo to the platform order number returned when creating the order. If you supplied extOrderNo, data.extOrderNo links to your own original order. Refunds additionally carry data.refundOrderNo. Onboarding uses application references; whitelist notifications identify an address item rather than an order. These references are separate from the notification type.
Keep verified notifications with an unsupported bizType for investigation and alert rather than guessing a handler or marking the business operation complete. Only acknowledge HTTP 2xx after durable acceptance; use 5xx if you cannot retain the notification. Accept additional business fields for forward compatibility.
Some payloads have no unique event ID or operation version. Apply idempotency to the relevant business operation/state; do not permanently suppress future operations merely because an address or order ID repeats. Reconcile with the corresponding query API when the current state or event order is uncertain.
Callback verification examples
Pass the JWKSkeys array, callback headers, target derived from the actual callback URL as shown above, and raw body bytes; the expected client ID comes from your configuration. Reject duplicate signature headers first, and apply replay protection and business idempotency after verification.
- Python
- Java
- Node.js
- Go
callback_verify.py
4. Migration checklist
- Register your Ed25519 public key and switch API requests to v2.
- Add JWKS retrieval and v2 callback verification. Coordinate the callback version separately with the platform.
- Complete both migrations before the protocol v1 EOL. Dispatch by version during migration; never fall back after a verification failure.
client_secret remain unchanged.
5. Signature protocol v1 (HMAC-SHA256, EOL: 2027-01-31)
V1 uses the sharedsign_secret. Omit X-Signature-Version or set it to 1 while v1 is enabled.
String to Sign
Signature Calculation
Field Definitions
Reference Implementations
- Python
- Java
- Node.js
- Go
Legacy v1 request headers
All business requests must carry the following headers:Legacy v1 callback verification
Before the cutoff, clients explicitly configured for JSON/HMAC callbacks verify using their sharedsign_secret:
1, with no kid. Use the decoded URL path without query and compare HMAC in constant time. Apply the client, timestamp, replay and acknowledgement checks in §3.
Request & Response Conventions
Protocol SpecificationResponse Envelope
Downstream business responses use a single-layer JSON{ code, message, data? }, without additional gateway wrapping.
Successful response
Business code code = 1, business data in data:
200, with error details expressed by code / message:
200, code is a negative integer (negated gRPC StatusCode, e.g. -14 for UNAVAILABLE), with connection error details in message.
Gateway-Level Error
For routing failures, internal gateway errors, missing descriptors, and similar errors, the HTTP status reflects the error (e.g. 400 / 404 / 500 / 502). The response is a single-layer JSON object with error details in message or reason:
- HTTP
2xxdoes not imply business success or guarantee downstream delivery; always check the businesscode - Business code
codereflects business layer results:1means business success with result indata; other values indicate errors, with details inmessageorreason - How to determine success: HTTP
2xx+ businesscode == 1. Both conditions must be met - Authentication/signature errors may use
{code, reason}; see the checklist below.
Error Handling
HTTP Status Codes & Business Codes
Responses use a single-layer JSON envelope, with error details inmessage or reason. HTTP status reflects gateway/transport results; business code code reflects business processing results.
Authentication Failure Checklist
For v2 signature rejection, common outcomes include:
Check token expiry/client binding first, then version/key, exact payload bytes, clock and nonce uniqueness.
Rate Limiting
Rate Limit Exceeded Response Example
429, wait for the number of seconds in Retry-After, then retry with a fresh timestamp, nonce and signature. The delay is calculated dynamically; 30 above is only an example.
To adjust your quota, contact your account manager.

