Payments

Track payments from external payment providers. When a payment is confirmed via webhook, the system automatically generates a receipt.

Providers

ProviderCode
Kasikorn BankKBANK
SCB BankSCB
Bangkok BankBBL
Krungthai BankKTB

Payment Statuses

StatusMeaning
NOT_SENTPayment created, not yet sent to provider
SUBMITTINGBeing sent to provider
PENDINGAwaiting provider confirmation
SUCCEEDEDPayment confirmed by provider
FAILED_TECHNICALTechnical failure
FAILED_BUSINESSBusiness-rule failure (e.g. insufficient funds)
EXPIREDPayment window expired

POST /api/v1/payments

Register a new payment.

POST /api/v1/payments

Headers

HeaderRequiredDescription
X-API-Key✓Your API key
X-Idempotency-Key✓Unique key per request
Content-Type✓application/json

Request Body

FieldTypeRequiredNotes
sourceIdstring✓Your source code
sourcePaymentIdstring✓Your unique payment ID (max 128 chars)
amountnumber✓Positive number
currencystring✓3 uppercase letters (e.g. THB)
providerenum—Payment provider code. Uses source default if omitted
descriptionstring—Max 255 chars
metadataobject—Free-form key-value

Example

curl -X POST https://dev-etax.siamprop.app/api/v1/payments \
  -H "X-API-Key: sk_etax_your_key" \
  -H "X-Idempotency-Key: idem-pay-2026-001" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceId": "TESTSRC",
    "sourcePaymentId": "PAY-ORDER-12345",
    "amount": 1070,
    "currency": "THB",
    "description": "Order #12345",
    "metadata": { "orderId": "12345" }
  }'

Response — 202 Accepted

{
  "id": "cmmje4qjf000lou0k06atfrsi",
  "sourcePaymentId": "PAY-ORDER-12345",
  "provider": "KBANK",
  "amount": 1070,
  "currency": "THB",
  "providerStatus": "NOT_SENT"
}

Error Cases

errorCodeHTTPCause
DUPLICATE_PAYMENT409sourcePaymentId already exists
PAYMENT_PROVIDER_NOT_CONFIGURED422No provider configured for source
PAYMENT_PROVIDER_NOT_ALLOWED422Specified provider is not enabled for this source
UNSUPPORTED_PAYMENT_PROVIDER422Specified provider code is not recognized

GET /api/v1/payments/:id

GET /api/v1/payments/{paymentId}?sourceId=TESTSRC

Example

curl "https://dev-etax.siamprop.app/api/v1/payments/cmmje4qjf000lou0k06atfrsi?sourceId=TESTSRC" \
  -H "X-API-Key: sk_etax_your_key"

GET /api/v1/payments

List payments.

GET /api/v1/payments?sourceId=TESTSRC&page=1&limit=20
ParameterRequiredDefaultDescription
sourceId✓—Your source code
provider—allFilter by provider
status—allFilter by providerStatus
sourcePaymentId——Filter by your payment ID
page—1—
limit—20Max 100