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
amountis in cents and is used for each billing cycle.- Without
trial_end, the first charge runs immediately and the subscription starts asactiveafter success. - With
trial_end, Pagou may validate the card first and keep the subscription astrialinguntil the trial ends. - An unknown
customer_idreturns404. - A disabled subscription permission returns
403.
Subscribe to a catalog plan
Sendproduct_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}.
amountis the product price timesquantity(an integer from 1 to 999999, default 1).interval,interval_count,currencyandmax_cyclescome from the product.- You may still send any of those fields, but each one must match the product. An omitted field never conflicts.
trial_endandfailure_policystay yours: the product’s trial and failure policy settings are not applied.productscannot be sent withproduct_id, andquantityrequiresproduct_id; either returns422.- The subscription belongs to the product’s store.
Fixed number of charges
Sendmax_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_startandcurrent_period_end- latest transaction
id, when present

