Skip to main content

Request

smilepayz teamsAbout 2 min

HTTP Request

Service Code90
NameAPI transaction pay in
Versionv2.0
HTTP MethodPOST
Path{Base URL}/v2.0/transaction/pay-in

Header Parameters

AreaFieldAttributeTypeDescription
HeaderContent-TypeMStringapplication/json
X-TIMESTAMPMStringyyyy-MM-ddTHH:mm:ssTZD
X-SIGNATUREMStringsignature
X-PARTNER-IDMStringmerchant ID

Tips

  • X-SIGNATURE = SHA256withRSA(private_key, stringToSign)
  • private_key is merchant rsa private key
  • stringToSign = X-TIMESTAMP + "|" + merchant_secret + "|" + minify(requestBody)
  • minify(requestBody) is convert the request parameters to JSON string, and then remove line breaks, spaces, and other escape characters
  • we provide some development languages minify and SHA256withRSA demo. please refer to signature

Body Parameters

AreaFieldAttributeTypeDescription
BodyorderNoMString(32)unique no. length between 6 and 32
purposeMString(64)purpose
merchantMObjectMerchant
moneyMObjectMoney
areaCNumberArea
additionalParamCObjectAdditionalReq
redirectUrlOString(256)Redirect to customer url
callbackUrlOString(256)the notify address that to notify merchant the final order status
productDetailOString(128)production description
itemDetailListOList(Object)ItemDetail
billingAddressOObjectBillingAddress
shippingAddressOObjectShippingAddress
paymentMethodOStringPaymentMethod
payerOObjectPayer
receiverOObjectReceiver
expiryPeriodONumberexpiryPeriod (in seconds, 3600)

OrderNo Format

important

  • orderNo format:
    • in Sandbox and merchantId = sandbox-20001 must start with: S20001xxxxxxx
    • in Production and merchantId = 20001must start with: 20001xxxxxxx
    • Only numbers and letters are supported, no special symbols are allowed
  • paymentMethod can be empty. If empty will return cashier link.

Example Body – Transaction Request:

Complete Example
POST {Base URL}/v2.0/transaction/pay-in HTTP/1.2

Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001
{
  "orderNo": "2000102900000000000001",
  "purpose": "transaction for business bla bla",
  "productDetail": "electronics. Apple",
  "additionalParam": {},
  "paymentMethod": "BRI",
  "money": {
    "currency": "IDR",
    "amount": 10000
  },
  "itemDetailList": [
    {
      "name": "Apple Mac",
      "quantity": 1,
      "price": 10000
    }
  ],
  "billingAddress": {
    "countryCode": "10",
    "city": "Djakarta",
    "address": "djakarta #1002873",
    "postalCode": "10045",
    "phone": "62895359978010"
  },
  "shippingAddress": {
    "countryCode": "Indonesia",
    "city": "Djakarta",
    "address": "djakarta #1002873",
    "postalCode": "10045",
    "phone": "62895359978010"
  },
  "merchant": {
    "merchantId": "20001",
    "merchantName": "Betty"
  },
  "payer": {
    "name": "Betty",
    "email": "[email protected]",
    "phone": "62895359978010"
  },
  "receiver": {
    "name": "Vincent.CH",
    "phone": "62895359978010",
    "email": "[email protected]"
  },
  "expiryPeriod": 3600,
  "area": "10"
}
Example request for IDR
POST {Base URL}/v2.0/transaction/pay-in HTTP/1.2

Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001
{
  "orderNo": "2000102900000000000001",
  "purpose": "transaction for business bla bla",
  "additionalParam": {},
  "paymentMethod": "BRI",
  "money": {
    "currency": "IDR",
    "amount": 10000
  },
  "merchant": {
    "merchantId": "20001"
  },
  "area": "10"
}
Example request for THB
POST {Base URL}/v2.0/transaction/pay-in HTTP/1.2

Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001
{
    "additionalParam": {
        "payerAccountNo": "123456789009"//Mandatory For THB order
    },
    "area": 11,
    "merchant": {
        "merchantId": "20019"
    },
    "money": {
        "amount": 10000,
        "currency": "THB"
    },
    "orderNo": "S20019e9d98b01-0db2-44c9-9d45-7c",
    "paymentMethod": "QRPAY",
    "purpose": "Purpose For Transaction from Java SDK",
    "redirectUrl": "https://docs.smilepayz.com/en/"
}
Example request for BRL
POST {Base URL}/v2.0/transaction/pay-in HTTP/1.2

Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001
{
    "additionalParam": {
        "pixAccount": "489.824.888-80"  //Mandatory For BRL order
    },
    "area": 13,
    "merchant": {
        "merchantId": "20011"
    },
    "money": {
        "amount": 200,
        "currency": "BRL"
    },
    "orderNo": "200110edbb466-abb0-4682-968b-40",
    "paymentMethod": "PIX",
    "purpose": "Purpose For Transaction from Java SDK",
    "redirectUrl": "https://www.google.com/webhp"
}