Skip to main content
Back to API Reference
POST/api/v2/payins

Create Automated Deposit (POST /v2/payins)

ENDPOINT OVERVIEW

POST /api/v2/payins dynamically assigns the healthiest deposit channel and returns a hosted paypage_url. Note that signature middleware strips the leading /api prefix, so sign /v2/payins when calling /api/v2/payins. Code samples use api.example.com — live endpoints are issued at onboarding.

Protocol Rules

  • Include X-API-Key, X-Timestamp, and X-Signature. Strip the leading /api prefix before computing HMAC-SHA256 (sign /v2/payins).
  • Pass merchant_ref_id, currency_code, request_amount, UUIDv7 customer_id, customer_account_id, and redirect_url.
  • Query order state anytime via GET /api/v1/payins/{id} or cancel an unpaid order via POST /api/v2/payins/{id}/cancel.

Request Examples

# Note: api.example.com is a placeholder — your Sandbox & Production endpoints are issued at onboarding.
# Middleware strips /api before verifying, so compute X-Signature over /v2/payins.
curl -X POST https://api.example.com/api/v2/payins \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <your-api-key>" \
  -H "X-Timestamp: <unix-timestamp>" \
  -H "X-Signature: <hmac-sha256-of-path>" \
  -d '{
    "merchant_ref_id": "unique-order-ref-id-2025001",
    "currency_code": "THB",
    "request_amount": 1000,
    "customer_id": "0198cbc6-fd02-7459-a671-78c306d0a1ad",
    "customer_account_id": "0198cbc7-35ec-7c8c-8994-d3ac3e7f5255",
    "redirect_url": "https://merchant.example.com/payment/success"
  }'

Sample JSON Response

{
  "id": "0198cbff-db9b-7b6a-9f82-6a55fdfb6575",
  "merchant_ref_id": "unique-order-ref-id-2025001",
  "status": "pending",
  "request_amount": 1000,
  "paypage_url": "https://pay.example.com/pay/0198cbff-db9b-7b6a-9f82-6a55fdfb6575"
}