Skip to main content
Use this flow for a new recurring card plan. Everything on this page applies to card subscriptions. For Pix Automático, where the subscription starts as incomplete and the payer authorizes with a QR code, see Pix Automático Subscriptions.

Prerequisites

  • Subscriptions must be enabled for your account.
  • The customer must already exist in /v2/customers.
  • The card must be collected with Payment Element and returned as a pgct_ token.

Backend request

Behavior

  • amount is in cents and is used for each billing cycle.
  • Without trial_end, the first charge runs immediately and the subscription starts as active after success.
  • With trial_end, Pagou may validate the card first and keep the subscription as trialing until the trial ends.
  • An unknown customer_id returns 404.
  • A disabled subscription permission returns 403.

Subscribe to a catalog plan

Send product_id, the id of a recurring product in your catalog, instead of amount and interval. The subscription takes its billing terms from the product and can later move to another plan of the same family with PATCH /v2/subscriptions/{id}.
  • amount is the product price times quantity (an integer from 1 to 999999, default 1). interval, interval_count, currency and max_cycles come from the product.
  • You may still send any of those fields, but each one must match the product. An omitted field never conflicts.
  • trial_end and failure_policy stay yours: the product’s trial and failure policy settings are not applied.
  • products cannot be sent with product_id, and quantity requires product_id; either returns 422.
  • The subscription belongs to the product’s store.

Fixed number of charges

Send max_cycles (from 2 to 120) to end the subscription after that many paid charges, the first one included. It requires interval: "month", interval_count: 1, no trial_end and a failure_policy other than retry_then_unpaid; any other combination returns 422, and so does a later PATCH that switches the subscription to retry_then_unpaid. Pix Automático does not accept it. Each charge is a separate purchase on the buyer’s card statement, not a card installment, so the card limit is only used one charge at a time. After the last paid charge the subscription ends on its own; see Subscription Lifecycle.

What to store

  • subscription id
  • customer id
  • current status
  • current_period_start and current_period_end
  • latest transaction id, when present