Subscriptions
Subscriptions enable customers to make recurring payments for product access. Managing subscriptions requires storing additional customer information to facilitate future charges.
Subscription objects
The following core API resources are essential for subscription management:
RESOURCE | DEFINITION |
---|---|
Customer | Stores customer information for subscription purchases. The Customer object manages recurring charges and tracks subscribed products. |
ChargeIntent | Manages dynamic payment flows. ChargeIntent tracks customer checkout processes and handles additional authentication requirements. |
PaymentMethod | Stores customer payment instruments for recurring charges. Examples include credit cards stored on Customer objects. Typically used with the Charge Intents APIs. |
Product | Represents a purchasable good or service. |
Subscription | Manages a customer's scheduled recurring product purchases. Handles payment collection and ongoing product access. |
How payments work with subscriptions
Payment status
Payment processing varies by payment method and location. Since initial payments can fail (due to incorrect card information or insufficient funds), multiple payment outcomes are possible.
Frame generates a ChargeIntent to track each payment's lifecycle. The ChargeIntent ID links to the Subscription object, and its state determines the subscription status:
PAYMENT OUTCOME | CHARGEINTENT STATUS | SUBSCRIPTION STATUS |
---|---|---|
Success | succeeded | active |
Fails because of a card error | failed | incomplete |
Payment succeeded
When payment succeeds, the ChargeIntent status becomes succeeded
and the subscription becomes active
. At this point, you should grant access to your product. For detailed guidance on subscription lifecycle and provisioning best practices, refer to our guide.
Recurring charges
Frame automates recurring charge management:
- Initiates payments at the start of new billing cycles
- Handles payment retries upon failure, with up to 3 attempts at 24-hour intervals
- Updates subscription status to
past_due
after initial failure - Changes status to
unpaid
after maximum retries, halting further attempts
The subscription lifecycle
This is what the recommended subscription flow looks like:
- You must have active recurring products, active customers and payment methods that linked to the customers before creating subscription.
- You create the subscription. The status of the subscription is
pending
. - The customer pays the first invoice.
- When the payment succeeds: The subscription
status
moves toactive
and Frame sends acustomer.subscription.created
event. - When the payment failed: The subscription
status
moves toincomplete
and Frame sends acustomer.subscription.incomplete
event. - You provision access to your product. You can confirm whether the invoice has been paid by setting up an event destination and listening for the
customer.subscription.created
event, or, you can manually checking the subscription object and looking forsubscription.status=active
.
Successful payments
Upon successful invoice payment, the subscription becomes active
, indicating you should provision product access.
Failed payments
Subscriptions maintain active
status while automatic payments succeed. Failed payments trigger:
- Status update to
past_due
- Frame initiates recovery attempts based on retry rules
- Status changes to
unpaid
if recovery fails
Cancel subscriptions
Cancellation prevents new charges and stops automatic payment collection. The subscription becomes unmodifiable, including metadata. If your customer wants to resubscribe, you need to collect new payment information from them and create a new subscription.
Subscription statuses
STATUS | DESCRIPTION |
---|---|
pending | Initial status upon subscription creation. |
incomplete | Payment method charge failed (card declined, expired, etc.) |
active | The subscription is in good standing and the most recent payment is successful. It's safe to provision your product for your customer. |
past_due | Latest invoice payment failed. Transitions to unpaid after exhausting retry attempts. |
canceled | Terminal state indicating subscription cancellation. No further updates possible. |
unpaid | Latest charge remains unpaid but subscription persists. Revoke product access as payment attempts and retries have been exhausted. |
Subscription events
Frame triggers events for subscription creation and changes. Some events occur immediately upon creation, while others follow billing intervals. We recommend implementing an event destination for monitoring.
Ensure your integration handles events appropriately, such as sending payment failure notifications or managing access revocation upon cancellation.
The following table describes the most common events related to subscriptions and, where applicable, suggests actions for handling the events.
EVENT | DESCRIPTION |
---|---|
customer.created | Sent when a Customer is successfully created. |
customer.subscription.created | Sent when the subscription is created and active. |
customer.subscription.incomplete | Sent when the subscription is created but the payment fails to complete. |
customer.subscription.updated | Sent when a subscription is updated. |