Skip to main content

Pay-in collection

About 4 min

Thailand region pay-in API (THB). See Payment methods.

Request

POST/v2.0/transaction/pay-in

Request Path:

sandbox: https://sandbox-gateway.smilepayz.com/v2.0/transaction/pay-in
production: https://gateway.smilepayz.com/v2.0/transaction/pay-in

Header Parameters

FieldRequiredTypeDescription
Content-TypeMStringapplication/json request body.
X-TIMESTAMPMStringFormat: yyyy-MM-ddTHH:mm:ss±HH:mm
X-SIGNATUREMStringSignature of JSON body (see product Signature doc).
X-PARTNER-IDMStringYour merchantID

Body Parameters

FieldRequiredTypeDescription
orderNoMString(32)Merchant-unique id
purposeMString(64)Memo to payer
merchantMObjectWraps merchantId and optional sub-merchant fields.
    merchantIdMStringSmilepayz merchantId for this call.
    merchantNameOStringMerchant display name.
    subMerchantIdOStringSub-merchant ID.
    subMerchantNameOStringName for subMerchantId.
moneyMObjectCurrency plus amount for this transaction.
    currencyMStringFixed to THB.
    amountMNumberAmount (up to 2 decimal places). See Money
payerMObjectPayer object per region rules (see Payer model).
    nameMStringBeneficiary full name (UTF-8).
    bankNameMStringBank code (e.g. KBANK, BBL, SCB); see Payment methods doc.
    accountNoMStringSettlement accountNo if gateway returns it.
paymentMethodMStringSee Payment methods doc.
expiryPeriodONumberExpiryPeriod, default 3600.
redirectUrlOString(256)HTTPS post-pay return URL, max 256 chars.
callbackUrlOString(256)HTTPS async status URL, max 256 chars.

Example Body – Transaction Request:

Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001

Responses

HTTP Request

FieldRequiredTypeDescription
Content-TypeMStringapplication/json request body.
X-TIMESTAMPMStringFormat: yyyy-MM-ddTHH:mm:ss±HH:mm

Body Parameters

FieldRequiredTypeDescription
codeMString00 success, other values error.
messageMStringUTF-8 human-readable result line.
orderNoMStringMerchant-unique id
tradeNoOStringSmilepayz tradeNo for this order.
merchantMObjectWraps merchantId and optional sub-merchant fields.
    merchantIdMStringSmilepayz merchantId for this call.
    merchantNameOStringMerchant display name.
    subMerchantIdOStringSub-merchant ID.
    subMerchantNameOStringName for subMerchantId.
moneyMObjectCurrency plus amount for this transaction.
    currencyMStringFixed to THB.
    amountMNumberAmount (up to 2 decimal places). See Money
    payAmountONumberSettled amount after fees (decimal THB).
transactionTimeMStringyyyy-MM-ddTHH:mm:ss±HH:mm
channelMObjectChannel payload (paymentUrl, qrString, …).
    paymentMethodOStringSee Payment methods doc.
    paymentUrlMStringCashier URL to open for the payer.
    qrStringOStringPIX or channel copy-paste string if returned.
    receiverBankNameOStringBank code when channel is bank transfer.
    vaNumberOStringVA / reference when returned.
    uploadReceiptOInteger1 if this order requires payer to upload a payment slip; 0 otherwise. When 1, call the Upload Receipt API after the payer completes the bank transfer.
statusOStringOrder or payment status enum value.
Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00

Notification/Callback

Callback signature ≠ request signature

Do not verify callback X-SIGNATURE with the request-signing formula. See Callback Signature.

HTTP Request

FieldRequiredTypeDescription
Content-TypeMStringapplication/json request body.
X-TIMESTAMPMStringFormat: yyyy-MM-ddTHH:mm:ss±HH:mm
X-SIGNATUREMStringSee Callback Signature

Body Parameters

FieldRequiredTypeDescription
orderNoMStringMerchant-unique id
tradeNoMStringSmilepayz tradeNo for this order.
merchantIdMStringSmilepayz merchantId for this call.
merchantNameMStringMerchant display name.
subMerchantIdOStringSub-merchant ID.
subMerchantNameOStringName for subMerchantId.
paymentMethodMStringSee Payment methods doc.
transactionTimeMStringFormat: yyyy-MM-ddTHH:mm:ss
statusMStringOrder or payment status enum value.
moneyMObjectCurrency plus amount for this transaction.
    currencyMStringFixed to THB.
    amountMNumberAmount (up to 2 decimal places). See Money
    payAmountONumberNet amount when returned.
payerOObjectPayer object per region rules (see Payer model).

Return

Important

Respond with the string SUCCESS only.

{
    "orderNo": "20011b5baff0ed8ac4f0c873920e",
    "tradeNo": "1112001125042408363186433",
    "merchantId": "20011",
    "merchantName": "Smilepayz Demo Store",
    "subMerchantId": "",
    "subMerchantName": "",
    "paymentMethod": "BANK",
    "transactionTime": "2025-04-24T08:36:32+07:00",
    "status": "SUCCESS",
    "money": {
        "currency": "THB",
        "amount": 50000
    },
    "payer": {
        "name": "Somchai Saetan",
        "accountNo": "*****67890"
    }
}