Transaction API
About 3 min
Introduce
Service Code | 90 |
---|---|
Name | API Transaction Pay In |
Version | 1.0 |
HTTP Method | POST |
Path | .../{version}/transaction/pay-in |
orderNo Inspection rule
- orderNo is generated by the merchant and is globally unique and does not allow duplications
- It is recommended to add the merchantId as a prefix to the order number to increase differentiation.
- in Sandbox Environment merchantId =
sandbox-10001
must start with:S10001xxxxxxx
- in Production Environment merchantId =
10001
must start with:10001xxxxxxx
- Only numbers and letters are supported, no special symbols are allowed
- in Sandbox Environment merchantId =
- If a transaction times out, the transaction Status is checked by calling the
Inquiry Status
interface throughorderNo
Request Header
Field | Attribute | Type | Description |
---|---|---|---|
Content-Type | Mandatory | String | String represents indicate the media type of the resource (e.g. application/json, application/pdf) |
Authorization | Mandatory | String | String starts with keyword “Bearer ” followed by access_token (e.g. Bearer eyJraWQiOi...Jzc29zIiiY) |
X-TIMESTAMP | Mandatory | String | Merchant's current local time in yyyy-MM-ddTHH:mm:ssTZD format |
X-SIGNATURE | Mandatory | String | Created using Symmetric signature HMAC_SHA512 algorithm. Refer to:Authentication Specification |
ORIGIN | Optional | String | Origin Domain www.yourdomain.com |
X-PARTNER-ID | Mandatory | String | MerchantID. Unique ID for a partner as MerchantID |
X-EXTERNAL-ID | Mandatory | String | Numeric String. Reference number that should be unique in the same day |
CHANNEL-ID | Mandatory | String | PJP’s channel id Device identification on which the API services is currently being accessed by the end user (customer) |
Request Body Parameter
Field | Attribute | Type | Description |
---|---|---|---|
orderNo | Mandatory | String(32) | String Transaction Unique ID. |
purpose | Mandatory | String(64) | String The reason to transaction |
productDetail | Optional | String(128) | String The subject matter of this transaction |
additionalParam | Optional | String(128) | String additional parameter |
itemDetailList | Optional | List<ItemDetail> | Json String The products for this transaction. Refer to: ItemDetail |
billingAddress | Optional | Address | Json String Address for billing. Refer to: BillingAddress |
shippingAddress | Optional | Address | Json String Address for shipping. Refer to: ShippingAddress |
money | Mandatory | Money | Json String Net amount of the transaction. Refer to: Money |
merchant | Mandatory | Merchant | Json String merchant information. Refer to: Merchant |
paymentMethod | Optional | String(6) | String Payment option which shows the provider of this payment. Refer to: PaymentMethod |
payer | Mandatory | Payer | Json String Transaction initiator. Refer to: Payer |
receiver | Mandatory | Receiver | Json String Trading beneficiaries. Refer to: Receiver |
expiryPeriod | Optional | Number | Validity period of payment link (in seconds) Example: 3600 |
redirectUrl | Optional | String(64) | Redirect to customer url |
callbackUrl | Optional | String(64) | Callback to customer url |
feeMethod | Optional | String(12) | String Admin Fee Method,Default value: Included. Included: The Admin Fee will be deducted from your balance. Excluded:Admin Fee will be added to payment. |
Response Body Parameter
Field | Attribute | Type | Description |
---|---|---|---|
responseCode | Mandatory | String(32) | String Response code. success=2009000 |
responseMessage | Mandatory | String(64) | String Response description |
orderNo | Mandatory | String | String Transaction identifier on service provider system. Must be filled upon successful transaction |
tradeNo | Optional | String | String Transaction identifier on service consumer system |
status | Mandatory | String | String status: PROCESSING, SUCCESS, FAILED... Refer to: TransactionStatus |
merchant | Mandatory | Merchant | Json String Net amount of the transaction. Refer to: Merchant |
transactionTime | Mandatory | String | String Transaction time |
money | Mandatory | Money | Json String Net amount of the transaction. Refer to: Money |
channel | Mandatory | Payer | Json String Transaction initiator. Refer to: PayChannel |
Sample Parameter
Sample Request
curl -X POST 'https://sandbox-gateway.smilepay.id/v1.0/transaction/pay-in' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE3NDA0NzA0NzIsImV4cCI6MTc0MDQ3MTM3MiwiaWF0IjoxNzQwNDcwNDcyLCJNRVJDSEFOVF9JRCI6InNhbmRib3gtMTAwMDEifQ.eMcSoq4bSnJJOPhplQwW7wSz8f6rdh6U7Tv0L4lZxog' \
-H 'X-TIMESTAMP: 2025-02-25T16:01:45+07:00' \
-H 'X-SIGNATURE: so39+A3G7AU6i4Gx8aiLkNFJ+zpZop6JU3V6xYeYGaznCjP5DchHQirOQxu5uXbvPHagvd1TUK3sMZbFJSjkyQ==' \
-H 'ORIGIN:www.yourdomain.com' \
-H 'X-PARTNER-ID: sandbox-10001' \
-H 'X-EXTERNAL-ID: T_1737537970911' \
-H 'CHANNEL-ID: 95221' \
-H 'Content-Type: application/json' \
-d '{
"paymentMethod": "BRI",
"payer": {
"name": "test",
"email": "[email protected]",
"phone": "0877983192",
"address": "Jalan Pantai Mutiara TG6, Pluit, Jakarta"
},
"receiver": {
"name": "smilepay",
"email": "[email protected]",
"phone": "0877983192",
"address": "Jl. Pluit Karang Ayu 1 No.B1 Pluit"
},
"orderNo": "T_1737537970911",
"purpose": "Purpose For Transaction from Java SDK",
"productDetail": "Product details",
"additionalParam": "other descriptions",
"itemDetailList": [
{
"name": "mac A1",
"quantity": 1,
"price": 10000
}
],
"billingAddress": {
"address": "Jl. Pluit Karang Ayu 1 No.B1 Pluit",
"city": "jakarta",
"postalCode": "14450",
"phone": "0877983192",
"countryCode": "Indonesia"
},
"shippingAddress": {
"address": "Jl. Pluit Karang Ayu 1 No.B1 Pluit",
"city": "jakarta",
"postalCode": "14450",
"phone": "0877983192",
"countryCode": "Indonesia"
},
"money": {
"currency": "IDR",
"amount": 10000
},
"merchant": {
"merchantId": "sandbox-10001",
"merchantName": "smilepay"
}
}'
Sample Response
{
"tradeNo": "T101100012502251505384450",
"orderNo": "T_1737537970911",
"status": "PROCESSING",
"merchant": {
"merchantId": "sandbox-10001",
"merchantName": "smilepay",
"accountNo": "000",
"shopName": null
},
"transactionTime": "2025-02-25T15:05:38+07:00",
"money": {
"currency": "IDR",
"amount": 10000
},
"channel": {
"paymentMethod": "BRI",
"vaNumber": "472094356793292",
"qrString": "QR Code to be completed",
"paymentUrl": "https://sandbox-gateway.smilepay.id/cashier/#/loading?tradeNo=T101100012502251505384450×tamp=1740470738465&token=epN3AOY4XAniBwLbPcooLxYaAnqvVNq9erzrclWQp5CBrVXRxLjMkPhK4vRob",
"additionalInfo": null
},
"responseCode": "2009000",
"responseMessage": "Successful"
}