payment_attempt.created
Sent when a payment attempt is created — a customer’s first try to pay a
transaction, or a retry after switching payment method.
A transaction can have several attempts before one succeeds; each one
fires its own payment_attempt.created.
Headers
Section titled “Headers”| Header | Description |
|---|---|
X-Baiyar-Signature |
t=<unix timestamp>,v1=<hex HMAC-SHA256> — see Verifying Webhook Signatures |
Content-Type |
application/json |
Payload
Section titled “Payload”{ "id": "evt_N6NWhxzQIDRRmreNoKfB", "type": "payment_attempt.created", "created_at": "2026-09-02T09:00:00Z", "data": { "id": "att_8Kx3mQ9dPz2Nc7RwAB12", "transaction_id": "txn_QpL9jZ4mR1sVn6TdWX78", "project_id": "project_IChAi2NR4vzKN3SgEYPI", "reference": "ORDER-2026-0002", "provider": "doku", "provider_payment_id": "sandbox_018f1f29...", "payment_method": { "type": "qris" }, "charged_amount": 15000, "currency": "IDR", "fee_amount": 105, "merchant_net": 14895, "status": "pending", "expires_at": "2026-09-02T09:15:00Z", "created_at": "2026-09-02T09:00:00Z" }}| Field | Type | Description |
|---|---|---|
id |
string | Unique event ID — use it to deduplicate retried deliveries, not data.id |
type |
string | Always payment_attempt.created |
created_at |
date-time | When the event was generated |
data.id |
string | The attempt’s ID |
data.transaction_id |
string | The parent transaction’s ID |
data.payment_method |
object | { "type": "qris" } or { "type": "virtual_account", "bank": "..." } |
data.status |
string | Always pending — an attempt is only ever created in this state |
data.expires_at |
date-time | When this specific attempt’s payment instructions expire, if applicable |
data doesn’t include payment instructions or the checkout URL — the
customer already has both from the API call or checkout flow that created
this attempt. Call
GET /v1/payments/{data.transaction_id}
with your API key if you need the transaction’s current state.
Testing
Section titled “Testing”There’s no sandbox simulator for this event — trigger it by actually
creating a sandbox payment (POST /v1/payments, or completing a checkout
session) and watching your endpoint receive the delivery within a few
seconds. Switching payment method mid-checkout fires it again for the new
attempt.