Skip to main content
A subscription connects a customer to a plan. While a subscription is active, Paygentic issues an invoice every billing period, collects payment, and keeps the customer’s entitlements up to date. To create a subscription, see Customer Lifecycle.
To collect payments, connect a payment provider (Stripe or Airwallex) in the dashboard under Set Up Payments. Without a payment provider, Paygentic still issues invoices, but customers can’t pay them online and don’t receive invoice emails.

Subscription lifecycle

  1. You create a subscription for a customer.
  2. If the plan charges anything in advance, Paygentic issues the first invoice, called Invoice 0. The subscription becomes active when the customer pays it.
  3. Each billing period, Paygentic issues an invoice. The customer pays it on the invoice payment page, or Paygentic charges their saved payment method automatically.
  4. If an automatic charge fails, Paygentic retries it and emails the customer. The subscription stays active.
  5. When you end the subscription, Paygentic issues a final invoice and cancels the customer’s entitlements.

Subscription statuses

The first invoice

If the plan has charges billed in advance, such as a setup fee or the first month’s fee, Paygentic issues Invoice 0 when you create the subscription. The subscription stays pending_payment until Invoice 0 is paid. To collect the payment, send the customer to payment.checkoutUrl from the subscription response. This link opens the invoice payment page. When the customer pays, the subscription becomes active and Paygentic sends the subscription.activated.v0 webhook. If the plan has nothing to charge in advance, Paygentic doesn’t issue Invoice 0 and the subscription is active immediately. The invoice payment page expires after sessionExpiryMinutes, which is 240 minutes by default. If the customer doesn’t pay in time, Paygentic cancels Invoice 0 and ends the subscription. To try again, create a new subscription.

How invoices are paid

The subscription’s autoCharge setting controls how the customer pays each invoice. You can set autoCharge when you create a subscription, or update it later:
For automatic charges, the customer needs a saved payment method. The customer can save one when they pay Invoice 0, or add one later in the customer portal. If a renewal is coming up and no payment method is saved, the renewal reminder asks the customer to add one.
API Reference: See the Update Subscription endpoint for all the fields you can change.

When an automatic charge fails

When an automatic charge fails, the subscription stays active. The customer keeps access to the plan, and Paygentic continues to issue invoices each period. Paygentic retries the charge and emails the customer, and you decide whether to change or end the subscription. This section applies to renewal invoices. If Invoice 0 isn’t paid, the subscription ends. See The first invoice.

Retry schedule

Paygentic retries a failed card charge up to three times after the first failure: Paygentic doesn’t send an email for each retry. If a retry succeeds, the invoice status changes to PAID and the customer receives a payment confirmation. Both emails include a link to the invoice payment page, so the customer can pay at any time without waiting for the next retry. Paygentic doesn’t retry a charge in these cases:
  • The card can’t be charged again. For example, the card was reported lost or stolen. The invoice status changes to PAYMENT_FAILED and the customer receives the final email right away.
  • The customer has no saved payment method. The customer receives the final email. The invoice stays ISSUED, and the customer can still pay it on the invoice payment page.
Both emails follow the customer’s invoiceIssued setting. See Customer emails.

Find failed payments

Paygentic doesn’t send a webhook when a subscription charge fails. To find invoices that need your attention, list invoices with the PAYMENT_FAILED status. Add subscriptionId to check one subscription, or leave it out to check all of them. You can run this check on any schedule that suits your business, for example once a day.
Response (abbreviated):
Each invoice includes paymentUrl, a link to the invoice payment page. You can show this link in your app or send it to the customer. If the customer pays later, Paygentic sends the invoice.paid.v0 webhook.
The payment.failed.v0 webhook applies only to Payment Links. Paygentic doesn’t send it for subscription invoices.

Decide what happens to the subscription

Because the subscription stays active, you decide what happens after a failed payment. For example, you can limit access, move the customer to a smaller plan, or end the subscription. We recommend acting when the invoice status changes to PAYMENT_FAILED. This is when Paygentic stops retrying and sends the final email, so your action matches what the customer has been told. To help the customer pay, send them a customer portal link or the invoice’s paymentUrl. From there, they can add a new payment method and pay the invoice.

End a subscription

To end a subscription, call the termination endpoint with a reason. The subscription ends immediately, and you can’t schedule it for a later date.
When a subscription ends, Paygentic:
  1. Changes the status to terminated.
  2. Issues a final invoice for the current billing period. If Invoice 0 is still unpaid, Paygentic cancels it instead.
  3. Cancels the customer’s entitlements and voids their grants, including purchased credits.
  4. Cancels any upcoming renewal reminder.
  5. Sends the subscription.cancelled.v0 webhook.
If the subscription has already ended, the request has no effect.
API Reference: See the Terminate Subscription endpoint.

Webhooks

For invoice events, see Invoices. For payloads, see Webhooks.

Next steps