Danamon Virtual Account is a bank transfer method facilitated by Bank Danamon. Despite the name, customers can pay using any Indonesian Bank account to complete payment. Payment can be made through ATM, mobile banking, internet banking, and Indonesian bank channels that supports paying virtual accounts.
Steps to integrate :
- Send the charge API request to Midtrans.
- Redirect your customer back to your page by configuring Finish URL in Midtrans's Dashboard > Snap Preferences or via API Request.
- Handle notifications.
Open amount and close amount VA has the exact same API contract - by default close amount VA type is activated for you. If you want to activate open amount VA, contact Midtrans support or your sales PIC for further assistance.
By default, default expiry time for bank transfer is 24 hours unless specified by merchant (min 20s, max 180 days).
Sample JSON Request Body
{
"transaction_details": {
"order_id": "ORDER-101",
"gross_amount": 10000
},
"item_details": [{
"id": "ITEM1",
"price": 10000,
"quantity": 1,
"name": "Midtrans Bear",
"brand": "Midtrans",
"category": "Toys",
"merchant_name": "Midtrans"
}],
"customer_details": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "+628123456"
},
"enabled_payments": ["danamon_va"],
"danamon_va": {
"va_number": "12345678"
}
}
Parameter | Description |
---|---|
transaction_details Transaction Details Object (required) | Unique transaction ID |
item_details Item Details Object (optional) | Shopping item details will be paid by customer |
customer_details Customer Details Object (optional) | Details of the customer |
enabled_payments Array (optional) | Set what payment method to show in Snap's payment list. Value: danamon_va |
danamon_va Danamon Virtual Account (optional) | Danamon Virtual Account payment options |
For a full list of request body parameters please refer to the Request Body (JSON Parameter) section
Note: Please also refer to the Custom VA Number section if you're looking to define your own VA number for your customers.
API Operations for Danamon VA
Danamon VA supports two API operations: Get Status, and Cancel. These operations use the transaction_id as the identifier to process the payment. The transaction_id can be obtained from the HTTP notification (Webhook).
Get Status API
Use this API to check the current status of a transaction.
curl --location 'https://api.sandbox.midtrans.com/v2/{transaction_id}/status' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'transaction-source: SNAP_API' \
--header 'Authorization: Key'
{
"status_code": "200",
"transaction_id": "A120240830074017NP16XMU4JTID",
"gross_amount": "20000.00",
"currency": "IDR",
"order_id": "sample-store-1725003597",
"payment_type": "dana",
"signature_key": "1b1f71e1b1b525e6c58c09f845c8b6b6d911ddfce34820bc52a9e6e5cf654a5f40639d6e33e510a2e9095c234b122becbe1ad919da2dedea3a4343f7905656d2",
"transaction_status": "settlement",
"fraud_status": "accept",
"status_message": "Success, transaction is found",
"merchant_id": "M007743",
"transaction_time": "2024-08-30 14:40:17",
"settlement_time": "2024-08-30 14:40:21",
"expiry_time": "2024-08-30 14:55:17"
}
Cancel API
Use this API to cancel a transaction.
curl --location --request POST 'https://api.sandbox.midtrans.com/v2/{transaction_id}/cancel' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'transaction-source: SNAP_API' \
--header 'Authorization: Key'
{
"status_code": "200",
"status_message": "Success, transaction is canceled",
"merchant_id": "G379181825",
"gross_amount": "20000.00",
"currency": "IDR",
"payment_type": "dana",
"transaction_status": "cancel",
"fraud_status": "accept",
"transaction_time": "2024-08-30 14:55:45"
}
API Usage Notes
- The transaction_id is the key identifier for all API operations with DANA. Ensure you retrieve and store this ID from the HTTP notification.
- Replace {transaction_id} in the API endpoints with the actual transaction ID received from the HTTP notification.
- Always check the
status_code
andstatus_message
in the response to confirm the success of your API call.