Skip to Content
Paycose Docs
FlowEvents

Subscription events

What data you get for subscription.created, .updated, .resumed, .paused, .canceled, and .trial_will_end.

Fires as a subscription's status changes — created, renewed, resumed, paused, canceled, or nearing the end of its trial.

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

Prop

Type

{
  "id": "sub_01J9ABCDEFGHJKMNPQRSTV",
  "object": "subscription",
  "customer_id": "cus_01J8XYZABCDEFGHJKMNPQR",
  "line_items": [
    {
      "product_id": "prod_01J8XYZABCDEFGHJKMNPQR",
      "product_name": "Pro plan",
      "unit_amount": 150000,
      "quantity": 1,
      "amount_total": 150000,
      "currency": "thb"
    }
  ],
  "total": 150000,
  "currency": "thb",
  "status": "active",
  "collection_method": "charge_automatically",
  "current_period_start": 1784937600,
  "current_period_end": 1787616000,
  "trial_end": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "metadata": { "order_id": "SO-2026-0042" }
}

All six events share this shape — only status and the matching timestamps change.

Status changes

  • New subscriptions. A subscription Paycose bills itself with charge_automatically starts as incomplete and becomes active when its first invoice is paid, or at once when that invoice has nothing to collect. One with a trial starts as trialing. One with send_invoice starts as active, unless you create it with payment_behavior=default_incomplete.
  • Failed renewals. When a payment fails, an active or trialing subscription moves to past_due.
  • Retries run out. The country's dunning setting decides what happens to a past_due subscription: canceled by default, as on Stripe (subscription.canceled, reason payment_failed), or unpaid, or left past_due. Only a past_due subscription becomes unpaid; paying the open invoice brings it back to active.

There's no separate "trialing" or "past_due" event — a subscription entering one of those states is reported as subscription.updated, with data.object.status showing the actual value. subscription.trial_will_end fires once, ahead of trial_end, as a reminder — it doesn't change status.

On this page