Charge customers on a recurring basis

  1. Create a subscription product.
  2. Create the subscription.
  3. Wait for subscription.active before granting access.
  4. Handle subscription.past_due and subscription.canceled.
trialing -> active -> past_due -> canceled
         -> canceled
await accend.subscriptions.create({
  customerId: "cus_123",
  productId: "prod_123",
  paymentMethod: "pix_manual"
});
EventWhat you should do
subscription.activeGrant access
subscription.renewedKeep access active
subscription.past_dueWarn the customer and restrict access
subscription.canceledRevoke access