Skip to main content
Every payment in Pandabase follows a defined lifecycle from creation to completion. Understanding this lifecycle helps you build reliable integrations and handle edge cases.

Overview

Order statuses

StatusDescription
PENDINGOrder created, awaiting payment
PROCESSINGPayment received, fulfillment in progress
COMPLETEDOrder fulfilled successfully
CANCELLEDPayment failed, expired, or was canceled
FAILEDPayment failed
REFUNDEDOrder was refunded
CHARGEBACKA dispute was opened on this order

Payment statuses

StatusDescription
PENDINGPayment intent created, awaiting customer action
PROCESSINGPayment is being processed
COMPLETEDPayment successfully collected
FAILEDPayment failed
REFUNDEDPayment was refunded
DISPUTEDCustomer filed a dispute

Lifecycle flow

1. Payment initiated

When a customer proceeds to pay, an order and payment are created with PENDING status. A PAYMENT_PENDING webhook event is fired.
{
  "event": "PAYMENT_PENDING",
  "id": "evt_abc123",
  "timestamp": "2026-03-07T12:00:00.000Z",
  "data": {
    "order": {
      "id": "ord_abc123",
      "orderNumber": "cs_abc123",
      "status": "PENDING",
      "amount": 2999,
      "currency": "USD",
      "customFields": null,
      "metadata": null,
      "items": [...]
    },
    "customer": { "id": "cus_abc123", "email": "customer@example.com" },
    "geo": null
  }
}
At this stage, geo data (city, region, country) may be null — it is enriched asynchronously after checkout. Subsequent events will include full geo data.

2. Payment succeeds

Once the payment provider confirms the payment, the payment moves to COMPLETED and the order moves to PROCESSING (fulfillment in progress) or COMPLETED (already fulfilled). A PAYMENT_COMPLETED webhook event is fired.
PAYMENT_COMPLETED is the primary event to listen for when fulfilling orders. It fires when the payment is confirmed and includes the full order data including customFields and metadata.

3. Payment fails

If the payment is declined, expires, or the customer abandons checkout, the order moves to CANCELLED. A PAYMENT_FAILED webhook event is fired. If a coupon was applied, its usage count is automatically restored.

4. Refund

When a merchant issues a refund, the order status changes to REFUNDED and the payment status changes to REFUNDED. A PAYMENT_REFUNDED webhook event is fired.

5. Dispute

If a customer opens a chargeback with their bank, the order moves to CHARGEBACK and the payment moves to DISPUTED. The disputed amount plus a $20.00 fee is deducted from the store’s balance. A PAYMENT_DISPUTED webhook event is fired. If the dispute is resolved, either PAYMENT_DISPUTE_WON (balance restored, order returns to COMPLETED) or PAYMENT_DISPUTE_LOST (funds stay deducted) is fired.

Webhook events by lifecycle stage

StageEventKey data
Payment initiatedPAYMENT_PENDINGorder, customer
Payment confirmedPAYMENT_COMPLETEDorder, customer, geo
Payment failedPAYMENT_FAILEDorder, customer
Refund issuedPAYMENT_REFUNDEDorder, customer
Dispute openedPAYMENT_DISPUTEDorder, customer
Dispute wonPAYMENT_DISPUTE_WONorder, customer
Dispute lostPAYMENT_DISPUTE_LOSTorder, customer