Skip to main content

Pay-in collection

About 3 min

Credit Card region pay-in API (USD / EUR). For paymentMethod values in responses and callbacks, see Payment methods.

Minimal merchant payload

Do not send card number, CVV, expiry, or billing address in this API. Credit card pay-in always returns a hosted cashier paymentUrl; the payer enters card and billing details on the SmilePayZ cashier page.

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.
    currencyMStringUSD (area 40) or EUR (area 41).
    amountMNumberAmount (up to 2 decimal places). See Money
payerOObjectOptional payer contact fields (see Payer model). No card fields.
    nameOStringPayer name if known upfront.
    phoneOStringPayer phone if known upfront.
    emailOStringPayer email if known upfront.
productDetailOString(128)Product or service description.
expiryPeriodONumberOrder expiry in seconds; default 3600.
redirectUrlOString(256)HTTPS post-pay return URL, max 256 chars.
callbackUrlOString(256)HTTPS async status URL, max 256 chars.

Not in pay-in request

The following are collected on the hosted cashier, not in this API: cardNo, cardType, cardCcv, cardExpMonth, cardExpYear, billing address fields (firstName, lastName, country, city, address, state, postcode).


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.
moneyMObjectCurrency plus amount for this transaction.
    currencyMStringUSD or EUR.
    amountMNumberAmount (up to 2 decimal places). See Money
transactionTimeMStringyyyy-MM-ddTHH:mm:ss±HH:mm
channelMObjectChannel payload.
    paymentMethodOStringVISA or MASTERCARD chosen by the payer on the cashier; see Payment methods.
    paymentUrlMStringHosted cashier URL—redirect the payer here to enter card details.
statusOStringTypically INIT until the payer completes payment on the cashier.

Integration

Save tradeNo and open channel.paymentUrl for the payer. Do not expect vaNumber, qrString, or card data in this response.

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.

Callback shape matches other pay-in regions. Respond with the string SUCCESS only. money.currency is USD or EUR; paymentMethod is VISA or MASTERCARD.

See Callback guide for signature verification.