Create Payment
The following is an API endpoint to create payment.
Used to create payment.
Endpoint
/api/merchant/transaction/create
Headers
- Name
X-Client-Id
- Type
- uuid
- Description
Client ID (provided by BJPAY or retrieve from our Merchant Portal).
- Name
X-Client-Secret
- Type
- string
- Description
Client Secret (provided by BJPAY or retrieve from our Merchant Portal).
- Name
X-Request-Time
- Type
- YYYY-MM-DDTHH:mm:ssZ
- Description
Request Time should be ISO 8601 and will be used to generate Signature.
- Name
Content-Type
- Type
- application/json
- Description
Content type application/json
Body
- Name
paymentCode
- Type
- string
- Description
Payment that is available API Endpoint.
- Name
referenceNumber
- Type
- string
- Description
Your own reference number, can be uuid, or some id generator.
- Name
customerName
- Type
- string
- Description
Your customer name.
- Name
customerEmail
- Type
- string
- Description
Your customer email.
- Name
customerPhoneNumber
- Type
- string
- Description
Your customer phone number.
- Name
finishNotifyUrl
- Type
- string
- Description
Your Backend notify endpoint.
- Name
finishReturnUrl
- Type
- string
- Description
Your Backend callback endpoint.
- Name
expiredAt
- Type
- string
- Description
Expired payment in format RFC 3339.
- Name
totalAmount
- Type
- number
- Description
Total amount.
- Name
items
- Type
- array
- Description
List of items in the payment.
Request
Example
POST
/api/merchant/transaction/create{
"paymentCode": "GOPAY",
"referenceNumber": "BJP05134e418d311b55e5cd9e13",
"customerName": "BANGJEFF",
"customerEmail": "[email protected]",
"customerPhoneNumber": "62123224456",
"finishNotifyUrl": "https://my-cool-apps.com/webhook/notify",
"finishReturnUrl": "https://my-cool-apps.com/thankyou",
"expiredAt": "2024-06-23T13:00:48+07:00",
"totalAmount": 58000,
"items": [
{
"name": "MLBB Diamond - 250",
"quantity": 1,
"amount": 58000
}
]
}
Response
Example
{
"code": "OK", // Check Response Code List
"message": "Success", // Check Response Message List
"data": {
"transactionNumber": "BJP-X9063-03A2DA25525CCF84099149",
"referenceNumber": "BJP05134e418d311b55e5cd9e13",
"paymentCode": "GOPAY",
"paymentName": "GoPay",
"customerName": "BANGJEFF",
"customerEmail": "[email protected]",
"customerPhoneNumber": "62123224456",
"finishNotifyUrl": "https://my-cool-apps.com/api/notify",
"finishReturnUrl": "https://my-cool-apps.com/api/callback",
"expiredAt": "2024-06-23T13:00:48+07:00",
"totalAmount": 58000,
"fee": 1160,
"totalReceived": 56840,
"paymentDest": "https://simulator.sandbox.midtrans.com/gopay/partner/app/payment-pin?id=937664ad-1f53-4d89-ba99-1d0451d824de",
"paymentDestType": "REDIRECT",
"status": "UNPAID",
}
}