Skip to Content
Paycose Docs
FlowEvents

Payment intent events

What data you get for payment_intent.succeeded, payment_intent.canceled and payment_intent.payment_failed.

Fires when a payment intent reaches a final status: payment_intent.succeeded when the payment is collected, payment_intent.canceled when the intent is canceled. When an attempt is declined, payment_intent.payment_failed fires and the intent waits for a new payment method. Each status change sends one event, whatever caused it: an API call, a provider webhook, or an expiry.

Each event arrives as an event object. The examples on this page show its data.object.

Prop

Type

payment_intent.succeeded

Sent once, when the intent's charge is paid. With capture_method manual, that is when you capture it.

{
  "id": "pi_01J8XYZABCDEFGHJKMNPQR",
  "object": "payment_intent",
  "status": "succeeded",
  "amount": 150000,
  "amount_received": 150000,
  "currency": "thb",
  "cancellation_reason": "",
  "cancellation_source": "",
  "customer_id": "cus_01J8XYZABCDEFGHJKMNPQR",
  "charge_id": "ch_01J9ABCDEFGHJKMNPQRSTV",
  "livemode": false
}

payment_intent.payment_failed

Sent once per declined attempt. The intent goes back to requires_payment_method; its failure_code and failure_message say why, and the failed charge stays on charge_id. Confirm again with another payment method, or let the customer retry.

{
  "id": "pi_01J8XYZABCDEFGHJKMNPQR",
  "object": "payment_intent",
  "status": "requires_payment_method",
  "amount": 150000,
  "currency": "thb",
  "cancellation_reason": "",
  "cancellation_source": "",
  "customer_id": "cus_01J8XYZABCDEFGHJKMNPQR",
  "charge_id": "ch_01J9ABCDEFGHJKMNPQRSTV",
  "failure_code": "card_declined",
  "failure_message": "The card was declined by the issuer. Try a different card, or contact your bank.",
  "livemode": false
}

payment_intent.canceled

Sent once, when the intent is canceled. That happens when you call POST /payment_intents/{id}/cancel (cancellation_reason merchant_canceled, cancellation_source api), when its charge expires (for example qr_expired with local_ttl), or when the provider cancels the payment.

{
  "id": "pi_01J8XYZABCDEFGHJKMNPQR",
  "object": "payment_intent",
  "status": "canceled",
  "amount": 150000,
  "currency": "thb",
  "cancellation_reason": "qr_expired",
  "cancellation_source": "local_ttl",
  "customer_id": "cus_01J8XYZABCDEFGHJKMNPQR",
  "charge_id": "ch_01J9ABCDEFGHJKMNPQRSTV",
  "canceled_at": 1785001200,
  "failure_message": "payment expired before completion",
  "livemode": false
}

customer_id, charge_id, canceled_at, failure_code, and failure_message only appear when the intent has them.

These events carry a short summary of the intent, not the full object. Retrieve the intent with GET /payment_intents/{id} for every field, including next_action, which comes from the intent's latest charge.

On this page