Skip to main content
A Subscription connects a Customer to a Plan. It governs the generation of invoices and the automatic collection of payments on a recurring schedule.

Subscription Lifecycle

Subscriptions move through several states:
1

Trialing

The subscription is in a free trial period. No payment has been collected yet.
2

Active

Payment has been successfully collected, and the customer has access to the service.
3

Past Due

Payment failed (e.g., expired card). Credibill will retry according to your retry settings. The customer may still have access.
4

Unpaid

Retries have been exhausted. Access should usually be revoked. This only applies to card payments.
5

Canceled

The subscription has been terminated. No further invoices will be generated.

Proration

When a customer changes plans (upgrades or downgrades) in the middle of a billing cycle, Credibill automatically calculates Proration.
  • Upgrade: Charged immediately for the difference.
  • Downgrade: Nothing happens.
Proration cannot be disabled.

How to subscribe a customer

Subscribe a customer to a plan, which creates a recurring billing relationship and starts generating invoices on the specified schedule.
  • Endpoint: https://giant-goldfish-922.convex.site/api/v1/subscriptions/create
  • Method: POST
  • Authentication: Authorization: Bearer <CREDIBILL_API_KEY>

Request Body Schema

Examples

Usage in a Component

Response

When you subscribe a customer to a plan, the API responds with a JSON object containing the subscription details.

Getting Subscriptions

Retrieve subscription information by fetching a specific subscription or listing subscriptions with optional filters.
  • Endpoint: https://giant-goldfish-922.convex.site/api/subscriptions
  • Method: GET
  • Authentication: Authorization: Bearer <CREDIBILL_API_KEY>

Query Parameters

Examples

Usage in a Component

Response Examples

Get Single Subscription:
List Subscriptions:

How to cancel a subscription

Cancel a customer’s subscription. You can choose to cancel immediately or at the end of the current billing period.
  • Endpoint: https://giant-goldfish-922.convex.site/api/v1/subscriptions/cancel
  • Method: DELETE
  • Authentication: Authorization: Bearer <CREDIBILL_API_KEY>

Query Parameters

Examples

Usage in a Component

Response

When you cancel a subscription, the API responds with a success message.