Create Payment
Create single or bulk payment transactions.
/payments
Creates payment transactions. The request can contain a single transaction or a bulk payload through the payments field.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer sk_xxx |
Content-Type | Yes | application/json |
Idempotency-Key | No | Unique ID for a single request. For bulk, use payments[].idempotency_key. |
Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
amount | integer | Yes for single request | Order amount. |
currency | string | No | Default IDR. |
payment_method | string | No | qris (default), bca_va, bri_va, bni_va, or bank_jago_transfer. |
provider | string | No | QRIS supports gopay (default) and shopeepay; the three VA methods use gopay_va; bank_jago_transfer uses bank_jago. The method must be enabled for the merchant. Also applies to each payments[] item. |
merchant_reference_id | string | No | Order ID from the merchant system. |
customer | object | No | Customer data. |
metadata | object | No | Extra merchant data. |
payments | array | No | Transaction list for bulk create. Maximum 50 items per request. |
payments[].idempotency_key | string | Recommended | Unique ID per bulk item. |
Payment Method Fields
| Field | Description |
|---|---|
payment_method | Payment method code. If empty, the API uses qris. |
provider | Payment provider. Internal provider accounts are selected automatically and omitted from responses. |
qris_payload | Payment payload in QRIS responses. |
qris_image_url | QR image URL in QRIS responses. |
payment_instructions | Bank transfer instructions returned for bank_jago_transfer, including the recipient and exact payable amount. |
Single Request Example
curl -X POST "https://api.bayargo.id/payments" \ -H "Authorization: Bearer sk_xxx" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: ORDER-1024" \ -d '{ "amount": 150000, "payment_method": "qris", "provider": "gopay", "merchant_reference_id": "ORDER-1024", "customer": { "name": "Nara", "email": "nara@example.com" }}'Bulk Request Example
curl -X POST "https://api.bayargo.id/payments" \ -H "Authorization: Bearer sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "payments": [ { "amount": 150000, "payment_method": "qris", "merchant_reference_id": "ORDER-1024", "idempotency_key": "ORDER-1024" }, { "amount": 89000, "payment_method": "qris", "merchant_reference_id": "ORDER-1025", "idempotency_key": "ORDER-1025" } ]}'Single Response
{
"payment": {
"id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
"reference_id": "PAY-LXAMPLE",
"merchant_reference_id": "ORDER-1024",
"payment_method_code": "qris",
"provider": "gopay",
"currency": "IDR",
"amount": 150000,
"fee_amount": 1050,
"net_amount": 150000,
"total_amount": 151050,
"status": "pending",
"qris_payload": "000201010212...",
"qris_image_url": "<qris_image_url>",
"gopay_deeplink": "https://link.gopay.co.id/...",
"expires_at": "2026-05-19T10:30:00Z",
"created_at": "2026-05-19T10:00:00Z",
"updated_at": "2026-05-19T10:00:00Z"
}
}Bulk Response
{
"payments": [
{
"id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
"reference_id": "PAY-LXAMPLE",
"merchant_reference_id": "ORDER-1024",
"payment_method_code": "qris",
"amount": 150000,
"fee_amount": 1050,
"net_amount": 150000,
"total_amount": 151050,
"status": "pending",
"expires_at": "2026-05-19T10:30:00Z"
}
]
}Response Fields
| Field | Description |
|---|---|
payment.id / payments[].id | Transaction UUID. |
payment.reference_id / payments[].reference_id | BayarGO transaction ID. |
payment.merchant_reference_id | Merchant order ID. |
payment.payment_method_code | Payment method. |
payment.amount | Order amount. |
payment.fee_amount | Payment fee. |
payment.net_amount | Amount recorded for the merchant. |
payment.total_amount | Amount the customer must pay. |
payment.status | Transaction status. |
payment.gopay_deeplink | GoPay continuation link when the provider is gopay and the upstream provider supplied one. |
payment.virtual_account_number | The bank VA number when GoPay has supplied the payment instructions. Read the payment details again if the number is still being prepared. Pay the returned total_amount, which can include a bank fee. |
payment.expires_at | Payment deadline; after it passes, pending transactions become expired. |
Fee Payer
| Value | Customer pays | Merchant receives |
|---|---|---|
buyer | amount + fee_amount | amount |
merchant | amount | amount - fee_amount |
QRIS is created dynamically by the provider and validated with provider transaction IDs, not amount matching.
Bank Jago transfer
bank_jago_transfer creates a payment against an eligible Bank Jago account configured by the platform. The platform reserves an account-scoped unique amount and returns the exact transfer instructions. Customers must transfer the returned payment_instructions.payable_amount; transferring only amount will not match the payment.
{
"payment_method": "bank_jago_transfer",
"provider": "bank_jago",
"amount": 150000,
"currency": "IDR",
"merchant_reference_id": "ORDER-1026"
}The response includes payment_instructions.bank_name, recipient_account_number, recipient_name, transfer_amount, unique_code, payable_amount, and instructions, plus the transaction's expires_at. Unique amounts are reserved per provider account, so the same code can be used by a different Jago account. A code is not reused within an account while a transfer could still be matched to its earlier payment.
If all safe unique amounts are reserved, the API returns 503 bank_jago_amount_temporarily_unavailable and a Retry-After header when the next reservation is expected to expire. Retry with the same idempotency key to retrieve the original payment; use a new key only when creating a new payment.
HTTP Error Code
| HTTP | Code | Description |
|---|---|---|
400 | invalid_json | Body is not valid JSON. |
400 | invalid_amount | amount must be greater than 0. |
400 | invalid_bulk_size | payments must contain 1 to 50 items. |
400 | unsupported_payment_method | Payment method is not supported. |
400 | payment_create_failed | Transaction could not be created. |
401 | invalid_api_key | Secret key is invalid. |
403 | merchant_not_approved | Merchant is not active. |
429 | rate_limited | Rate limit exceeded. |