Skip to content

Payin Callback API ​

Overview ​

Payin Callback API is used to receive order status change notifications. When an order status changes, Veloraya sends an asynchronous notification to the merchant so the merchant can update order status in time.

How to test callbacks in the testing environment? ​

Provide the order number and contact operations for manual operation.

Callback Mechanism ​

Trigger conditions ​

  • Payment success

Retry mechanism ​

ItemDescription
Max retries11 times (including the first push)
Interval30 seconds (first 6 retries)
Interval3 minutes (last 5 retries)
Timeout30 seconds
Retry conditionHTTP status != 200, business code != 10000, or network error
Success criteriaHTTP 200 with business response {"code": 10000, "message": "Success"}

Callback Request ​

Method ​

  • Method: POST
  • Content-Type: application/json
  • Encoding: UTF-8

Headers ​

HeaderTypeRequiredDescription
Content-TypestringYapplication/json
TimestampstringYTimestamp (milliseconds)
NoncestringYRandom string (UUID without dashes)
SignaturestringYSignature generated with Veloraya private key, used to verify callback authenticity

Callback Parameters (body) ​

ParameterTypeRequiredDescription
merchantIdstringYMerchant ID
orderIdstringYPlatform order ID
merchantOrderIdstringYMerchant order ID
orderStatusstringYOrder status, see order status enum
amountBigDecimalYOrder amount
currencystringYCurrency code
feeBigDecimalYFee
errorCodestringNError code (on failure)
errorMsgstringNError message (on failure)
createDatetimestringYOrder create time, format: yyyy-MM-dd HH:mm:ss
completionDatetimestringNOrder completion time, format: yyyy-MM-dd HH:mm:ss

Order status enum ​

ValueDescription
SUCCESSSuccess
FAILEDFailed

Callback Example ​

Success callback ​

json
{
  "amount": 500.00,
  "completionDatetime": "2025-11-19 18:04:55",
  "createDatetime": "2025-11-19 17:59:54",
  "currency": "THB",
  "fee": 55.00,
  "merchantId": "601091",
  "merchantOrderId": "ORDER5187977827671717",
  "orderId": "PAYIN1991084006458683392",
  "orderStatus": "SUCCESS"
}

Callback Response ​

Success response ​

The merchant must return HTTP 200 with business code 10000 to acknowledge:

json
{
  "code": 10000,
  "message": "Success"
}

Failure response ​

If processing fails, return an error message (the system will keep retrying):

json
{
  "code": 40001,
  "message": "Processing failed"
}

Note

Only returning {"code": 10000, "message": "Success"} stops the retry. Any other response (including non-200 HTTP status) triggers the retry mechanism.

Signature Verification ​

Verification steps ​

  1. Extract signature: get the Signature header
  2. Build verification content: timestamp={timestamp},nonce={nonce},body={bodyJson}
    • Note: the verification content does NOT include merchantId, only timestamp, nonce and body
  3. Verify with Veloraya public key: verify the signature with the public key provided by Veloraya
  4. Use the unified guide: reuse the "Callback Verification Guide" and Appendix B sample code in API Signature

Key notes ​

  • Veloraya public key: provided by Veloraya, used to verify callback signatures
  • Algorithm: SHA256withRSA
  • Encoding: UTF-8 + Base64

Notes ​

  • Callback URL configuration: the callback URL must be provided to the Veloraya team before go-live and must be accessible and stable
  • Signature verification: always verify callback signature legitimacy; use the unified callback verification logic per API Signature
  • Idempotency: implement idempotency to avoid duplicate processing; dedupe by orderId or merchantOrderId
  • Response format: must return {"code": 10000, "message": "Success"} to stop retries
  • Logging: log all callback requests, responses and processing time

Released under the MIT License.