IDEN
Wacommerce

Create Order & Payment Methods

Create an order via the Public API and choose a payment method with the payment.method field (qris, virtual_account, manual_transfer, cod, snap/payment_link).

Create an order via `POST /orders`. Orders support a `payment.method` field to choose the payment method, plus an optional `payment.bank` for virtual accounts. `billingType` and `payment.method` mirror each other — set both for consistency.

Supported payment methods

  • `snap` / `payment_link` — Midtrans Snap / payment link
  • `qris` — QRIS
  • `virtual_account` — virtual account (requires `payment.bank`, e.g. `bni`; currently active: BNI, BRI, Permata, CIMB)
  • `manual_transfer` — manual bank transfer
  • `cod` — cash on delivery

QRIS example

json{
  "to": "+628123456789",
  "billingType": "qris",
  "payment": { "method": "qris" }
}

Virtual Account example

json{
  "to": "+628123456789",
  "billingType": "virtual_account",
  "payment": { "method": "virtual_account", "bank": "bni" }
}

COD example

json{
  "to": "+628123456789",
  "billingType": "cod",
  "payment": { "method": "cod" }
}

Shipping discount

The order body accepts `shippingDiscount: { type, value }` to cut the shipping cost. `type` is `percentage` or `fixed`. Net shipping = `max(0, shipping − discount)` — the discount never drives shipping below zero.

json{
  "to": "+628123456789",
  "billingType": "cod",
  "payment": { "method": "cod" },
  "shippingDiscount": { "type": "percentage", "value": 50 }
}

The payment.method field

The `payment.method` field normalizes the payment method. If the payment provider (Midtrans) is not configured, the response may return status `PENDING_CONFIGURATION` with `provider: stub` — see the Midtrans not configured troubleshooting entry.

BCA VA is intentionally not a default option because the current Midtrans merchant returns 402 Payment channel is not activated. After BCA VA is active in Midtrans Dashboard, add bca to MIDTRANS_ENABLED_VA_BANKS.