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:

RESOURCEDEFINITION
CustomerStores customer information for subscription purchases. The Customer object manages recurring charges and tracks subscribed products.
ChargeIntentManages dynamic payment flows. ChargeIntent tracks customer checkout processes and handles additional authentication requirements.
PaymentMethodStores customer payment instruments for recurring charges. Examples include credit cards stored on Customer objects. Typically used with the Charge Intents APIs.
ProductRepresents a purchasable good or service.
SubscriptionManages 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 OUTCOMECHARGEINTENT STATUSSUBSCRIPTION STATUS
Successsucceededactive
Fails because of a card errorfailedincomplete

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:

  1. You must have active recurring products, active customers and payment methods that linked to the customers before creating subscription.
  2. You create the subscription. The status of the subscription is pending.
  3. The customer pays the first invoice.
  4. When the payment succeeds: The subscription status moves to active and Frame sends a customer.subscription.created event.
  5. When the payment failed: The subscription status moves to incomplete and Frame sends a customer.subscription.incomplete event.
  6. 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 for subscription.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

STATUSDESCRIPTION
pendingInitial status upon subscription creation.
incompletePayment method charge failed (card declined, expired, etc.)
activeThe subscription is in good standing and the most recent payment is successful. It's safe to provision your product for your customer.
past_dueLatest invoice payment failed. Transitions to unpaid after exhausting retry attempts.
canceledTerminal state indicating subscription cancellation. No further updates possible.
unpaidLatest 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.

EVENTDESCRIPTION
customer.createdSent when a Customer is successfully created.
customer.subscription.createdSent when the subscription is created and active.
customer.subscription.incompleteSent when the subscription is created but the payment fails to complete.
customer.subscription.updatedSent when a subscription is updated.