BayarGO

Create Payment

Create single or bulk payment transactions.

View as Markdown
POST/payments

Creates payment transactions. The request can contain a single transaction or a bulk payload through the payments field.

Headers

HeaderRequiredDescription
AuthorizationYesBearer sk_xxx
Content-TypeYesapplication/json
Idempotency-KeyNoUnique ID for a single request. For bulk, use payments[].idempotency_key.

Body Fields

FieldTypeRequiredDescription
amountintegerYes for single requestOrder amount.
currencystringNoDefault IDR.
payment_methodstringNoqris (default), bca_va, bri_va, bni_va, or bank_jago_transfer.
providerstringNoQRIS 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_idstringNoOrder ID from the merchant system.
customerobjectNoCustomer data.
metadataobjectNoExtra merchant data.
paymentsarrayNoTransaction list for bulk create. Maximum 50 items per request.
payments[].idempotency_keystringRecommendedUnique ID per bulk item.

Payment Method Fields

FieldDescription
payment_methodPayment method code. If empty, the API uses qris.
providerPayment provider. Internal provider accounts are selected automatically and omitted from responses.
qris_payloadPayment payload in QRIS responses.
qris_image_urlQR image URL in QRIS responses.
payment_instructionsBank transfer instructions returned for bank_jago_transfer, including the recipient and exact payable amount.

Single Request Example

cURL
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
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

FieldDescription
payment.id / payments[].idTransaction UUID.
payment.reference_id / payments[].reference_idBayarGO transaction ID.
payment.merchant_reference_idMerchant order ID.
payment.payment_method_codePayment method.
payment.amountOrder amount.
payment.fee_amountPayment fee.
payment.net_amountAmount recorded for the merchant.
payment.total_amountAmount the customer must pay.
payment.statusTransaction status.
payment.gopay_deeplinkGoPay continuation link when the provider is gopay and the upstream provider supplied one.
payment.virtual_account_numberThe 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_atPayment deadline; after it passes, pending transactions become expired.

Fee Payer

ValueCustomer paysMerchant receives
buyeramount + fee_amountamount
merchantamountamount - 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

HTTPCodeDescription
400invalid_jsonBody is not valid JSON.
400invalid_amountamount must be greater than 0.
400invalid_bulk_sizepayments must contain 1 to 50 items.
400unsupported_payment_methodPayment method is not supported.
400payment_create_failedTransaction could not be created.
401invalid_api_keySecret key is invalid.
403merchant_not_approvedMerchant is not active.
429rate_limitedRate limit exceeded.

On this page