Subscription Resource

With Subscriptions, customers make recurring payments for access to a product. Subscriptions require you to retain more information about your customers than one-time purchases because you need to charge them in the future.

🚧

This is an early access feature.

If you would like your account to be configured, please contact [email protected]

{
  "data":{
    "id": "subs_CbFCTDfxvMFNjwjVi26Uzhtj",
    "type": "subscription",
    "attributes": {
      "anchor_date":"2023-08-01",
      "cancellation_reason": null,
      "customer_id": "cus_CbFCTDfxvMFNjwjVi26Uzhtj",
      "default_customer_payment_method_id": "cus_pm_CbFCTDfxvMFNjwjVi26Uzhtj",
      "latest_invoice": {
        "id": "inv_CbFCTDfxvMFNjwjVi26Uzhtj",
        "amount": 1000000,
        "currency": "PHP",
        "due_date": "2023-08-01",
        "payment_intent": {
          "id": "pi_CbFCTDfxvMFNjwjVi26Uzhtj",
          "status": "succeeded"
        },
        "status": "paid"
      },
      "livemode": true,
      "next_billing_schedule": "2023-09-01",
      "plan":{
        "id": "plan_dQsAFCwcrfL7WTJL6Wcv769Q",
        "amount": 1000000,
        "currency": "PHP",
        "cycle_count": 5,
        "description": "Test plan without metadata",
        "interval": "monthly",
        "interval_count": 1,
        "name": "Basic Plan",
        "created_at": 1699585219,
        "updated_at": 1699585219,
      },
      "setup_intent": {
        "id": "pi_CbFCTDfxvMFNjwjVi26Uzhtj",
        "last_setup_error": "Expired card.",
        "next_action_url": "http://provider/authenticate/something",
        "status": "awaiting_next_action"
      },
      "status": "active",
      "cancelled_at": null,
      "created_at": 23432432,
      "updated_at": 23432432,
    }
  }
}        
    

id string
Unique ID of the resource.


type string
Represents the resource type. Value is always subscription.


anchor_date date
The date of the first payment, where the next billing schedules will be referenced. The date format is YYYY-MM-DD


cancellation_reason string
Reason why the subscription was canceled. Possible values are too_expensive, missing_features, switched_service, unused, or other.


customer_id string
ID of the Customer who subscribes to a Plan.


default_customer_payment_method_id string
Indicates the customer payment method to be used for the subsequent payments.


latest_invoice.id string
ID of the latest Invoice.


latest_invoice.amount integer
Amount of the latest Invoice.


latest_invoice.currency string
Currency of the latest Invoice.


latest_invoice.due_date date
Due date of the latest Invoice. The date format is YYYY-MM-DD


latest_invoice.payment_intent.id string
ID of the latest Invoice’s payment intent.


latest_invoice.payment_intent.status string
Status of the latest Invoice’s payment intent. Possible values are awaiting_payment_method, awaiting_next_action, processing, or succeeded.


latest_invoice.status string
Status of the latest Invoice. Possible values are draft, open, paid, or void.


next_billing_schedule date
The date of the next payment. The date format is YYYY-MM-DD


plan object
Plan details of the subscription. See plan attributes


setup_intent.id string
The ID of the payment_intent to be attached to the new payment method when changing the default payment method of the subscription.


setup_intent.last_setup_error string
This parameter specifies the reason for the latest failure that happened on setup intent. This attribute will only appear when status is marked as failed.


setup_intent.next_action_url string
The url for redirecting the customer to the authentication page. This attribute will only appear when status is awaiting_next_action.


setup_intent.status string
The status of setup_intent when changing the default payment method of the subscription


status string
Status of the Subscription. Possible values are incomplete, incomplete_cancelled, active, past_due, unpaid, or cancelled.


cancelled_at timestamp
The date when the Subscription has been canceled.


created_at timestamp
The date when the Subscription has been created.


updated_at timestamp
The date when the Subscription has been updated.