# Webhooks


> Receive and verify transaction status events.

Canonical: https://docs.bayargo.id/webhooks

Webhooks are sent to the URL registered in the merchant dashboard.

## Events

```txt
payment.created
payment.pending
payment.paid
payment.expired
payment.cancelled
payment.failed
payment.refund_processing
payment.refund_failed
payment.refunded
payment.settled
subscription_order.created
subscription_order.pending
subscription_order.paid
subscription_order.expired
subscription_order.cancelled
subscription_order.failed
```

| Event | Description |
| --- | --- |
| `payment.created` | Transaction was created. |
| `payment.pending` | Waiting for payment. |
| `payment.paid` | Payment was received. |
| `payment.expired` | Payment deadline has passed. |
| `payment.cancelled` | Transaction was cancelled. |
| `payment.failed` | Payment failed. |
| `payment.refund_processing` | Refund is being processed. |
| `payment.refund_failed` | Refund failed. |
| `payment.refunded` | Refund succeeded. |
| `payment.settled` | Transaction has entered settlement. |
| `subscription_order.created` | A plan checkout order and its payment were created. |
| `subscription_order.pending` | The plan checkout payment is waiting to be paid. |
| `subscription_order.paid` | The plan checkout payment was confirmed and the subscription was activated or scheduled. |
| `subscription_order.expired` | The plan checkout payment expired before confirmation. |
| `subscription_order.cancelled` | The plan checkout payment was cancelled. |
| `subscription_order.failed` | The plan checkout payment failed. |

## Payload

```json
{
  "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
  "event": "payment.paid",
  "reference_id": "PAY-LXAMPLE",
  "merchant_reference_id": "ORDER-1024",
  "status": "paid",
  "environment": "live",
  "amount": 150000,
  "fee_amount": 1050,
  "net_amount": 150000,
  "total_amount": 151050,
  "currency": "IDR",
  "payment_method": "qris",
  "provider": "gopay",
  "created_at": "2026-05-19T10:00:00Z",
  "updated_at": "2026-05-19T10:01:00Z"
}
```

## Headers

```http
Content-Type: application/json
User-Agent: BayarGO-Webhooks/0.1
X-Chiwa-Event: payment.paid
X-Chiwa-Delivery: 1d4c...
X-Chiwa-Signature: t=1779184860,v1=<hmac_sha256_hex>
```

Verify `X-Chiwa-Signature` before processing the payload.

Subscription checkout events use the `subscription_order.*` names and include the subscription
order ID so you can reconcile a plan purchase separately from ordinary payment events.

```json
{
  "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
  "event": "subscription_order.paid",
  "object": "subscription_order",
  "transaction_kind": "subscription",
  "subscription_order_id": "a7c16e5a-8f67-4d4a-b2d8-842aa7f08b5c",
  "reference_id": "PAY-LXAMPLE",
  "merchant_reference_id": "PLAN-ORDER-1024",
  "status": "paid",
  "environment": "live",
  "amount": 150000,
  "fee_amount": 0,
  "net_amount": 150000,
  "total_amount": 150000,
  "currency": "IDR",
  "payment_method": "qris",
  "provider": "gopay",
  "created_at": "2026-11-22T14:10:00Z",
  "updated_at": "2026-11-22T14:11:00Z"
}
```

## Merchant-owned payments

M2O payments send the same payment lifecycle events and flat payload fields. The `provider` and
`payment_method` identify the provider and method; the event does not contain the account slot code. Keep
the slot code with your order when creating a payment so your system can reconcile an event against
the correct account. See the [merchant-owned payments guide](https://docs.bayargo.id/merchant-owned-payments) for account
history and status lookup.

```json
{
  "id": "f2b1d5b0-7b1f-4c5d-9c37-93f0c8f6a001",
  "event": "payment.paid",
  "reference_id": "PAY-LXAMPLE",
  "merchant_reference_id": "ORDER-1024",
  "status": "paid",
  "environment": "live",
  "amount": 150000,
  "fee_amount": 0,
  "net_amount": 150000,
  "total_amount": 150123,
  "currency": "IDR",
  "payment_method": "bank_jago_transfer",
  "provider": "bank_jago",
  "created_at": "2026-11-22T14:10:00Z",
  "updated_at": "2026-11-22T14:11:00Z"
}
```
