Setup
1. Collect the customer’s payment method and create the mandate via SetupIntent
When collecting the user’s card on-session, create a mandate using a StripeSetupIntent. The user completes authentication during confirmation, and Stripe creates the mandate for that payment method.
- Set
intervaltosporadic— recharges are triggered by a balance threshold, not a fixed cadence. - Set
amount_typetomaximum- support varying charge amounts. - Set
amountto a sufficiently high value - account for variance in recharge amounts over time.
- Set
intervalto the corresponding recurrence (e.g.month). - Set
amount_typetofixedif the recurring fee is known, ormaximumif it is variable. - Set
amountto the known recurring fee or a sufficiently high maximum.
2. Wait for the mandate to become active
A mandate may remain inpending for up to 30 minutes after creation. You can check readiness in two ways:
- Listen to the
mandate.updatedwebhook from Stripe and wait untilstatusbecomesactive. - Retrieve the mandate by ID from the
SetupIntentand poll until it isactive.
inactive, it cannot be used. The customer will need to authorize a new mandate.
3. Create and map the mandate custom field
On the Metronome contract, create a custom field (e.g.stripe_mandate_id). Via the entity mapping UI, map this contract custom field to the Stripe invoice.payment_settings → default_mandate field.
4. Provision the customer in Metronome
Create the Metronome contract. Populate thestripe_mandate_id custom field with the mandate ID created in step 1. All invoices sent to Stripe will attempt to attach this mandate.
5. Listen for the action_required webhook
After the invoice is created with the associated mandate, the paymentIntent may transition to an action_required state. Stripe will issue a invoice.payment_action_required webhook.
6. Confirm payment
- If the customer approves the charge, the payment succeeds and the balance is released.
- If the customer does not respond or the mandate becomes inactive, the payment fails and enters the normal failure workflow. A new mandate must be collected and activated before future recharge attempts can succeed.
Limitations
- Mandates must be created and managed entirely in Stripe. Metronome does not expose an API for interacting with mandates other than returning the set custom field value.
- Mandates must be set up via a
SetupIntentsince all charges, including the first one, are off-session. - Metronome does not manage mandate lifecycle events. Payment failures are surfaced through the normal webhook and failure path. It is your responsibility to update the mandate in Stripe and take appropriate action before retrying.