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
- You create a subscription for a customer.
- If the plan charges anything in advance, Paygentic issues the first invoice, called Invoice 0. The subscription becomes active when the customer pays it.
- Each billing period, Paygentic issues an invoice. The customer pays it on the invoice payment page, or Paygentic charges their saved payment method automatically.
- If an automatic charge fails, Paygentic retries it and emails the customer. The subscription stays active.
- 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 stayspending_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’sautoCharge setting controls how the customer pays each invoice.
You can set
autoCharge when you create a subscription, or update it later:
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 staysactive. 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_FAILEDand 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.
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 thePAYMENT_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.
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 staysactive, 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.- Changes the status to
terminated. - Issues a final invoice for the current billing period. If Invoice 0 is still unpaid, Paygentic cancels it instead.
- Cancels the customer’s entitlements and voids their grants, including purchased credits.
- Cancels any upcoming renewal reminder.
- Sends the
subscription.cancelled.v0webhook.
API Reference: See the Terminate Subscription endpoint.
Webhooks
For invoice events, see Invoices. For payloads, see Webhooks.