Request
About 2 min
HTTP Request
Service Code | 90 |
---|---|
Name | API transaction pay in |
Version | v2.0 |
HTTP Method | POST |
Path | {Base URL}/v2.0/transaction/pay-in |
Header Parameters
Area | Field | Attribute | Type | Description |
---|---|---|---|---|
Header | Content-Type | M | String | application/json |
X-TIMESTAMP | M | String | yyyy-MM-ddTHH:mm:ssTZD | |
X-SIGNATURE | M | String | signature | |
X-PARTNER-ID | M | String | merchant ID |
Tips
X-SIGNATURE = SHA256withRSA(private_key, stringToSign)
private_key
is merchant rsa private keystringToSign = 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
andSHA256withRSA
demo. please refer to signature
Body Parameters
Area | Field | Attribute | Type | Description |
---|---|---|---|---|
Body | orderNo | M | String(32) | unique no. length between 6 and 32 |
purpose | M | String(64) | purpose | |
merchant | M | Object | Merchant | |
money | M | Object | Money | |
area | C | Number | Area | |
additionalParam | C | Object | AdditionalReq | |
redirectUrl | O | String(256) | Redirect to customer url | |
callbackUrl | O | String(256) | the notify address that to notify merchant the final order status | |
productDetail | O | String(128) | production description | |
itemDetailList | O | List(Object) | ItemDetail | |
billingAddress | O | Object | BillingAddress | |
shippingAddress | O | Object | ShippingAddress | |
paymentMethod | O | String | PaymentMethod | |
payer | O | Object | Payer | |
receiver | O | Object | Receiver | |
expiryPeriod | O | Number | expiryPeriod (in seconds, 3600) |
OrderNo Format
important
- orderNo format:
- in Sandbox and
merchantId = sandbox-20001
must start with:S20001xxxxxxx
- in Production and
merchantId = 20001
must start with:20001xxxxxxx
- Only numbers and letters are supported, no special symbols are allowed
- in Sandbox and
- 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"
}