Invoice object plus optional InvoiceItem, Payment, Client, etc.), with these recurrence fields on the Invoice object:| Field | Meaning |
|---|---|
name | Required. Subscription name |
subscription_period | Required. Interval count (defaults to 1) |
subscription_unit | Required. Interval unit: days, weeks, months, years (defaults to months) |
subscription_max_repeat | Max invoices to generate (empty = unlimited) |
subscription_issue_before | Days before the next date to issue each invoice |
active | Whether the generator is active (0/1) |
Invoice.client_id is required. The document type is set to subscription automatically. See Add New Invoice for the full reference of the remaining header / item / payment fields and their defaulting.curl --location --globoff 'https://.daftra.com/api2/invoices/add_subscription.json' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"Invoice": {
"client_id": 15,
"name": "Monthly retainer",
"subscription_period": 1,
"subscription_unit": "months",
"subscription_max_repeat": 12,
"subscription_issue_before": 3,
"active": 0,
"date": "2026-07-01",
"currency_code": "USD"
},
"InvoiceItem": [
{
"item": "Consulting service",
"unit_price": 100,
"quantity": 1,
"product_id": 12
}
]
}'{
"result": "successful",
"code": 202,
"id": 3120,
"invoice_number": "string"
}