> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpaycheckout.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Unpaid

> This event is triggered when a subscription becomes unpaid, indicating it is no longer active for billing.

<ResponseExample>
  ```json theme={null}
  {
    "eventId": "whe_fooD944t4VUKkaDT",
    "eventType": "subscription.unpaid",
    "eventTime": 1729608043615,
    "subscriptionId": "sub_fooBOwYsaK50AEfK",
    "nextPaymentDate": null,
    "remainingCycleCount": 2,
    "errorCode": "insufficient_funds",
    "metadata": { 
      "orderId": "12345",
      "customerNote": "Deliver after 5 PM" 
    }
  }
  ```
</ResponseExample>

{" "}

<ResponseField name="eventId" type="string">
  {" "}

  A unique identifier for this specific event. This ensures that each event can be
  tracked and processed individually.{" "}
</ResponseField>

<ResponseField name="eventType" type="string">
  {" "}

  Describes the type of event. In this case, it signifies that a subscription has
  transitioned to an unpaid state.{" "}
</ResponseField>

<ResponseField name="eventTime" type="integer">
  {" "}

  The timestamp when the event was generated, typically in milliseconds since the
  Unix epoch (January 1, 1970). This value can be used to track when the event occurred.{" "}
</ResponseField>

<ResponseField name="subscriptionId" type="string">
  {" "}

  A unique identifier for the specific subscription that has become inactive.{" "}
</ResponseField>

<ResponseField name="nextPaymentDate" type="integer">
  {" "}

  The next payment date for the subscription. This will typically be `null` when
  the subscription becomes inactive.{" "}
</ResponseField>

<ResponseField name="remainingCycleCount" type="integer">
  {" "}

  The number of billing cycles remaining for the subscription. For an inactive subscription,
  this will generally be `0`.{" "}
</ResponseField>

<ResponseField name="errorCode" type="string">
  A specific code indicating the reason for the subscription payment failure. This helps identify
  whether the failure was due to user error or processing error. For a complete list
  of error codes and their meanings, see our [Error Codes](/products/one-time-payments/error-codes) documentation.
</ResponseField>

<ResponseField name="metadata" type="object">
  A collection of key-value pairs that were provided when the object was
  created. These metadata values are echoed back in the response, allowing you
  to store and retrieve custom information such as context-specific attributes,
  references, or tags. This can be useful for correlating records in your system
  or attaching meaningful context to transactions.
</ResponseField>
