v1.0Last updated: Mar 2026

Claim TrueWallet Vouchers With One API Call.

Full API reference for claiming TrueWallet vouchers. Auth, retries, error codes, and examples included.

Your Angpao Claim Engine.

Dokmai Angpao API processes TrueWallet voucher claims through one secure endpoint with authentication, idempotency, and traceable request IDs.

Base URL

https://api.dokmaistore.com

Authentication

Production requests support either:

  • x-dokmai-api-key: <your_api_key>
  • Authorization: Bearer <buyer_jwt>

If both are provided, API key authentication is evaluated first.

Main Endpoint

POST/api/v1/angpao/redeem

Claims a voucher using a Thai phone number and voucher input.

Required Headers

Content-Type: application/json
x-dokmai-api-key: your_api_key_here
Idempotency-Key: claim-20260306-001

Idempotency-Key Rules

  • Strongly recommended for production.
  • Length: 8-128 characters.
  • Allowed charset: [A-Za-z0-9._:-].
  • Same caller + same key returns a cached result for safe retries.

Request Body

{
  "phoneNumber": "0900000000",
  "voucher": "https://gift.truemoney.com/campaign/?v=abc123..."
}

Voucher Field Aliases

Send at least one voucher field:

  • voucher
  • voucherCode
  • voucherUrl
  • link

Field Validation

FieldTypeRequiredValidation
phoneNumberStringYesThai format 0xxxxxxxxx
voucherStringYes*Voucher URL or code
voucherCodeStringYes*Alias of voucher
voucherUrlStringYes*Alias of voucher
linkStringYes*Alias of voucher

* One voucher field is required.

Response Format

Success (200)

{
  "success": true,
  "data": {
    "source": "dokmai_angpao",
    "provider": "truewallet",
    "amount": 88,
    "currency": "THB",
    "voucherId": "641f0e2e31b9f8xxxx",
    "detail": "Voucher redemption",
    "ownerName": "Gift Sender",
    "redeemerPhoneMasked": "090-***-0000",
    "redemptionDate": "2026-03-06T09:10:11.000Z",
    "expireDate": "2026-03-10T12:00:00.000Z",
    "providerCode": "SUCCESS"
  },
  "requestId": "89e7b18a-dad3-4eca-beb2-d8a4f0d8d8fa"
}

Error (Non-2xx)

{
  "success": false,
  "error": {
    "code": "angpao_not_found",
    "message": "Voucher not found",
    "retryable": false,
    "requestId": "89e7b18a-dad3-4eca-beb2-d8a4f0d8d8fa",
    "details": {
      "providerCode": "VOUCHER_NOT_FOUND"
    }
  }
}

Error Codes

CodeHTTPRetryableMeaning
unauthorized401NoMissing or invalid API key/JWT
forbidden403NoAuthenticated identity is not allowed
forbidden_service_scope403NoAPI key scope is not allowed
invalid_api_key401NoAPI key is invalid or inactive
rate_limited429YesCaller exceeded RPM
invalid_json400NoInvalid JSON body
invalid_body422NoBody is not a JSON object
missing_required_fields422NoMissing phoneNumber or voucher field
invalid_phone_number400NoInvalid Thai phone format
invalid_voucher_code400NoVoucher link/code is invalid
invalid_idempotency_key422NoIdempotency key format is invalid
unsupported_content_type415NoMust send application/json
angpao_not_found404NoVoucher not found
angpao_already_redeemed409NoVoucher already redeemed/out of stock
angpao_expired410NoVoucher expired
angpao_recipient_mismatch422NoCannot claim your own voucher
angpao_redeem_failed422NoProvider rejected the claim
provider_rate_limited429YesUpstream provider throttled
provider_unavailable503YesUpstream provider unavailable
provider_invalid_payload502YesUpstream returned invalid payload
storage_unavailable503YesDatabase/storage unavailable
internal_error500NoUnexpected internal failure

Rate Limit Headers

Every response includes:

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 119
X-RateLimit-Reset: 1760000000
X-Request-Id: 89e7b18a-dad3-4eca-beb2-d8a4f0d8d8fa

Throttled responses include:

Retry-After: 30

Quick Start (cURL)

curl -X POST "https://api.dokmaistore.com/api/v1/angpao/redeem" \
  -H "Content-Type: application/json" \
  -H "x-dokmai-api-key: YOUR_API_KEY" \
  -H "Idempotency-Key: claim-20260306-001" \
  -d '{
    "phoneNumber": "0900000000",
    "voucher": "https://gift.truemoney.com/campaign/?v=YOUR_CODE"
  }'

Quick Start (Node.js)

const response = await fetch('https://api.dokmaistore.com/api/v1/angpao/redeem', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-dokmai-api-key': process.env.DOKMAI_API_KEY,
    'Idempotency-Key': `claim-${Date.now()}`,
  },
  body: JSON.stringify({
    phoneNumber: '0900000000',
    voucher: 'https://gift.truemoney.com/campaign/?v=YOUR_CODE',
  }),
});

const payload = await response.json();

if (payload.success) {
  console.log('Claimed amount:', payload.data.amount);
} else {
  console.error(payload.error.code, payload.error.message, payload.error.requestId);
}

Web Form Endpoint (No-Auth UI Proxy)

POST/api/dokmaiservice/v1/angpao/redeem

This endpoint powers the claim form at angpao.dokmai.app.

  • No API key or JWT required.
  • Requires phoneNumber and voucher.
  • Protected by per-IP rate limits.
  • Internally forwards to POST https://api.dokmaistore.com/api/v1/angpao/redeem using server-side credentials.
  • Uses the same core API pipeline, so request tracking and usage logs are centralized.
  • Not intended for backend automation.

Operational Guidance

  • Persist requestId in logs for support and reconciliation.
  • Retry only when retryable: true.
  • Validate phone and voucher inputs before every request.