Chiwa Pay

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_methodstringNoDefault qris. Currently only qris is supported.
providerstringNogopay or shopeepay. Defaults to gopay for compatibility. Also applies to each payments[] item. The provider must be enabled for the merchant.
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.
providerQRIS 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.

Single Request Example

cURL
curl -X POST "https://api.chiwapay.com/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.chiwapay.com/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>",
    "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_idChiwa Pay 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.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.

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