Pennylane icon

Pennylane

Interact with Pennylane accounting API

Billing Subscription → Create

AI-generated

Summary

Create a new billing subscription for a specified customer with detailed invoice settings, recurring invoice scheduling, and invoice line items.

Inputs

  • Customer ID (required) — The ID of the customer for this subscription (integer).
  • Start Date (required) — The start date of the subscription in YYYY-MM-DD format.
  • Payment Method (required) — Select the payment method for invoices: offline/manual or GoCardless direct debit for automatic debiting.
  • Payment Conditions (required) — Set the payment terms for invoices such as upon receipt, 7 days, 15 days, etc.
  • Invoice Mode (required) — Choose how invoices are handled when generated: draft (awaiting validation), finalized, or finalized and emailed automatically.
  • Email Recipients — If Invoice Mode is 'Email', optionally specify up to 25 email addresses to send invoices; otherwise, customer's emails are used.
  • Recurring Frequency (required) — Specify how often invoices should be generated: weekly, monthly, or yearly.
  • Interval (required) — Set the interval between each invoice occurrence (e.g., 2 means every 2 weeks/months/years).
  • Number of Occurrences (required) — Define total invoices to generate; 0 means unlimited.
  • Day of Week — For weekly recurrence, specify the day of the week to generate invoices.
  • Day of Month — For monthly recurrence, specify the day of the month (1-31) to generate invoices.
  • Invoice Lines (required) — Provide one or more line items for invoices, including label, quantity, unit, unit price (string), VAT rate, and optional details like discount, product ID, and section rank.
  • Invoice Line Sections — Optionally group invoice lines into sections by rank, with titles and descriptions.
  • Additional Options — Optionally specify currency, language, PDF invoice subject, description, free text, special mentions, and global discount settings for the subscription invoices.

Output shape

a single record representing the created billing subscription with its configured details

API response provides full details of the created subscription including invoice configuration and schedule. No pagination applies to creation operation.

Examples

Example 1: Create a monthly billing subscription starting 2024-01-01 for customer ID 123, generating invoices automatically emailed to specified recipients with defined invoice lines and payment conditions.

Set customerId to '123', start date to '2024-01-01', recurringType to 'monthly', modeType to 'email', provide emails in modeRecipients, define invoiceLines with labels and prices, and select paymentMethod, paymentConditions accordingly.

Discussion