create_scheduled_charge
Create a scheduled charge for an existing customer. Supports one-time payments via PIX or Boleto, and recurring payments via credit card or Pix Automático.
Instructions
Schedule a future charge for an existing customer. Use list_customers first to find the customerId. type='one_time' is the simple case (PIX/Boleto). type='recurring' takes a recurrence config and silent-charges the saved card on every cycle past the first. Card method is recurring-only and requires productId. Pix Automático (methods: ['pix_automatic']) is BACEN auto-debit recurring Pix — the customer authorizes once and later cycles debit silently; it is recurring-only and requires productId. Optional trialDays (1..365, recurring-only) rebases cycle 1 to today + N days and emits customer.trial_started immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Schedule type. 'recurring' requires a recurrence block; 'one_time' must omit it. | |
| amount | Yes | Decimal BRL (e.g. 297.50). Always pass decimals, never centavos. | |
| dueDate | Yes | YYYY-MM-DD in São Paulo time. Must be today or future. | |
| methods | Yes | Payment methods to offer. 'card' is recurring-only and requires productId. 'pix_automatic' is Pix Automático (BACEN auto-debit recurring Pix): the customer authorizes once, then later cycles debit silently — only valid when type='recurring' and productId is set. | |
| metadata | No | Free-form JSON. Stored as JSONB; not interpreted by Garu. | |
| productId | No | Required when methods includes 'card' or 'pix_automatic'. Optional otherwise. | |
| trialDays | No | Free-trial duration in days (1..365). Recurring-only. When set, cycle 1 is rebased to today + N days and customer.trial_started fires immediately. | |
| customerId | Yes | Customer ID (must already be linked to the seller) | |
| recurrence | No | Cadence for type='recurring'. endsAfter and endsOn are mutually exclusive. | |
| description | No | Free-form text shown on the customer email and payment page | |
| maxRecoveryDays | No | Max days past dueDate the daily recovery sweep will still auto-bill a missed charge (1..365). Omit for the system default (14). | |
| externalReference | No | Seller-controlled identifier (deduping, reconciliation). |