Create a Scheduled Invoice

Creates a new scheduled invoice for automated recurring or one-time billing.

This system sets up a recurring or one-time schedule to generate invoices automatically based on specified parameters. This endpoint provides flexibility for creating automated billing workflows.

Key Features

calendar-alt
Flexible Scheduling

Creates a schedule to generate invoices at specified intervals using recurrence rules following the iCalendar RRule specification.

credit-card
Autopay Support

Supports optional autopay functionality by attaching a payment_method_id for automatic payment processing.

refresh
Smart Recalculation

Automatically recalculates the next_run_at time after each generated invoice or payment for seamless scheduling.

list-alt
Enhanced Details

Enables merchants to include metadata like tax, subtotal, and lineItems for comprehensive invoice detail. Optionally hide line items from customer-facing emails using hideCustomerLineItems.

envelope
Email Control

Allows merchants to control email notifications for generated invoices with customizable settings.

play-pause
Pause & Resume

Full control over schedule lifecycle with the ability to pause and resume billing as needed.

Usage Guide

The rule parameter follows the iCalendar RRule specification. Here are common examples:

Monthly Recurrence:

DTSTART=20231101T120000Z;FREQ=MONTHLY

Weekly Recurrence Until a Specific Date:

DTSTART=20231101T120000Z;FREQ=WEEKLY;UNTIL=20231231T000000Z;INTERVAL=1

Important: DTSTART must be a future date; past dates are invalid and will result in a 422 validation error.

Response Structure

CodeResponseReason
201Schedule CreatedThe schedule was successfully created.
400Bad RequestInvalid parameters or missing required fields.
422Validation ErrorDTSTART is in the past, or recurrence rules are incorrectly formatted.
500Internal Server ErrorUnexpected server error.

Important Considerations

exclamation-triangleBest Practices & Requirements

Metadata and Emails: Populate meta fields such as subtotal, tax, and lineItems to include these details in email notifications and invoices for better customer communication. Use meta.hideCustomerLineItems (boolean) to hide line item details from customer-facing emails while retaining them on the invoice record.

Future Start Dates: Always ensure DTSTART is set to a future date. Past dates are invalid and will trigger validation errors.

Automatic Recalculation: The system automatically recalculates the next_run_at time each time an invoice is generated or paid, ensuring accurate scheduling.

Audit Trail: Each generated invoice includes comprehensive timestamps and payment details for reporting and compliance purposes.

Invoice Lifecycle: When paused, schedules will not generate invoices until resumed with a valid future DTSTART. Plan pause periods accordingly to avoid billing gaps.

Body Params
string
required

The URL for the hosted invoice page.

number
required

The total amount for the invoice.

string

The iCalendar RRule recurrence rule string (e.g., DTSTART=20231101T120000Z;FREQ=MONTHLY;COUNT=12).

string

The ID of the customer to associate with the schedule.

string

The ID of the payment method for autopay. If omitted, the customer will pay manually.

boolean
Defaults to true

Whether to send email notifications when invoices are generated. Defaults to true.

files
array of strings

Array of file IDs to attach to the schedule.

files
meta
object

Metadata for the invoice, including line items, tax, and other details.

Responses
201

Schedule successfully created.

400

Bad Request - Invalid parameters or missing required fields.

422

Validation Error - DTSTART is in the past, recurrence rules are incorrectly formatted, or invalid field values.

500

Internal Server Error.

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here!