Build Full API Mode
Create Payment Session
A windowed time for the end customer to complete the payment, starting when the client initiates the payment request through your app. The payment session duration is customizable, with a default duration of 15 minutes.
POST [BASE_URL]/v2/payments
{
"clientReferenceId": "1743240981",
"amount": {
"value": 20000,
"currency": "IDR"
},
"paymentMethod": {
"type": "VIRTUAL_ACCOUNT"
},
"paymentMethodOptions": {
"virtualAccount": {
"channel": "PERMATA",
"virtualAccountName": "Reforza Harsya"
}
},
"mode": "API",
"autoConfirm": true,
"statementDescriptor": "Harsya",
"expiryAt": "2025-03-31T23:59:05Z",
"metadata": {
"invoiceNo": "INV001"
}
}Define Payment Method (For final payment method)
Set autoConfirm to true and fill paymentMethod and paymentMethodOptions object to finalize payment method from the previous step
{
"paymentMethod": {
"type": "VIRTUAL_ACCOUNT"
},
"paymentMethodOptions": {
"virtualAccount": {
"channel": "PERMATA",
"virtualAccountName": "Reforza Harsya"
}
},
"autoConfirm": true
}Confirm Payment Session (For incomplete payment method)
If you set autoConfirm to false on Create Payment Session API, you can finalize Payment Method by filling paymentMethod and paymentMethodOptions objects
POST [BASE_URL]/v2/payments/{id}/confirm
{
"paymentMethod": {
"type": "VIRTUAL_ACCOUNT"
},
"paymentMethodOptions": {
"virtualAccount": {
"channel": "PERMATA",
"virtualAccountName": "Reforza Harsya"
}
}
}Get Payment Information details
After creating and confirming Payment Session, show payment information details in your customized Payment page returned in the response.
{
"chargeDetails": [
{
"id": "b4db4aa5-4ee4-4722-b414-050c745c93cd",
"paymentSessionId": "7f65c757-355f-4645-ac14-028b34ab51b1",
"paymentSessionClientReferenceId": "1743313696",
"amount": {
"value": 10000,
"currency": "IDR"
},
"statementDescriptor": "",
"status": "WAITING_FOR_USER_ACTION",
"authorizedAmount": null,
"capturedAmount": null,
"isCaptured": false,
"createdAt": "2025-03-30T05:48:17.105883834Z",
"updatedAt": "2025-03-30T05:48:17.105883916Z",
"paidAt": null,
"virtualAccount": {
"channel": "PERMATA",
"virtualAccountNumber": "76630000123456",
"virtualAccountName": " - Reforza Harsya",
"expiryAt": "2025-03-30T23:59:05Z"
}
}
]
}
Last updated