Skip to content

Recurring Invoices

The Recurring Invoice object

object

Attributes

idstring
Other attributes
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
Examplejson
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

Create a recurring invoice

POST/recurring-invoices

Create a new recurring invoice schedule.
Link an existing invoice as the template and configure the generation frequency.
The source invoice's data (items, customer, notes) is used when generating new invoices.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

document_idstringrequired
namestringrequired
frequencystringrequired

Possible values: "daily", "weekly", "monthly", "yearly"

start_datestringrequired

Start date in YYYY-MM-DD format

Other parameters
intervalintegeroptional
day_of_weekintegeroptionalnullable
day_of_monthintegeroptionalnullable
month_of_yearintegeroptionalnullable
end_datestringoptional
auto_sendbooleanoptional
create_as_draftbooleanoptional
send_tostringoptionalnullable
payment_terms_daysintegeroptionalnullable
notify_ownerbooleanoptional
metadataobjectoptionalnullable
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.create({
  document_id: "inv_6595a27b5d35015c3ef0c3fd",
  name: "Monthly telemetry hosting for Horizon",
  frequency: "monthly",
  day_of_month: 1,
  start_date: "2025-02-01"
});

console.log(response);
Example:

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

List all recurring invoices

GET/recurring-invoices

Retrieve a paginated list of recurring invoice schedules with optional filtering and sorting.
Supports cursor-based pagination, flexible JSON querying with MongoDB-style operators, full-text search, and sorting.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Query parameters

limitintegeroptional

Number of results per request.

Default: 10

next_cursorstringoptional

Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.

prev_cursorstringoptional

Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.

include_total_countbooleanoptional

Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.

order_byoptional

Sort by one field or provide a repeated array for multi-column ordering. Prefix a field with - for descending order. When paginating, reuse cursors only with the same effective ordering.

querystring<json>optional

JSON query object for filtering results. Supports MongoDB-style operators.

Supported operators:
- equals or direct value - Exact match (default)
- gte - Greater than or equal
- lte - Less than or equal
- gt - Greater than
- lt - Less than
- in - Value in array
- notIn - Value not in array
- contains - String contains (case-insensitive)
- startsWith - String starts with
- endsWith - String ends with
- between - Value between two numbers/dates [min, max]

Allowed fields: id, name, status, frequency, document_id

Examples:
- {"total": {"gte": 1000}} - Invoices over 1000
- {"customer.name": {"contains": "Acme"}} - Customer name contains "Acme"
- {"date": {"between": ["2025-01-01", "2025-12-31"]}} - Date range

searchstringoptional

Full-text search query to filter results across multiple fields.
Searches are case-insensitive and match partial strings.
Searches across all text fields including names, descriptions, addresses, and metadata values.

deletedbooleanoptional

When true, returns only soft-deleted (trashed) items. Default false excludes deleted items.

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.list({ limit: 20 });

console.log(response);

Returns

dataarray of objects
paginationobject

Pagination metadata including cursors and result counts

json
{
  "data": [
    {
      "id": "rinv_6595a27b5d35015c3ef0c3fd",
      "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
      "document_id": "inv_6595a27b5d35015c3ef0c3fd",
      "name": "Monthly telemetry hosting for Horizon",
      "frequency": "monthly",
      "interval": 1,
      "day_of_week": null,
      "day_of_month": 1,
      "month_of_year": null,
      "start_date": "2025-02-01",
      "end_date": null,
      "next_run_date": "2025-02-01",
      "last_run_date": null,
      "status": "active",
      "auto_send": false,
      "create_as_draft": false,
      "send_to": null,
      "payment_terms_days": null,
      "notify_owner": true,
      "invoices_generated": 0,
      "last_generated_invoice_id": null,
      "last_error": null,
      "last_error_at": null,
      "metadata": {},
      "created_at": "2025-01-15T00:00:00.000Z",
      "updated_at": "2025-01-15T00:00:00.000Z",
      "deleted_at": null
    }
  ],
  "pagination": {
    "total": 1,
    "next_cursor": null,
    "prev_cursor": null,
    "has_more": false
  }
}

Get recurring invoice by ID

GET/recurring-invoices/{id}

Retrieve a single recurring invoice schedule by its unique identifier.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.get("inv_6595a27b5d35015c3ef0c3fd");

console.log(response);

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

Update a recurring invoice

PATCH/recurring-invoices/{id}

Update an existing recurring invoice schedule.
Only the provided fields will be updated.
Schedule changes automatically recalculate the next run date.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

Body parameters

namestringoptional
frequencystringoptional
intervalintegeroptional
day_of_weekintegeroptionalnullable
day_of_monthintegeroptionalnullable
month_of_yearintegeroptionalnullable
start_datestringoptional
end_datestringoptionalnullable
auto_sendbooleanoptional
create_as_draftbooleanoptional
send_tostringoptionalnullable
payment_terms_daysintegeroptionalnullable
notify_ownerbooleanoptional
metadataobjectoptionalnullable
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.update("inv_6595a27b5d35015c3ef0c3fd", {
  name: "Monthly telemetry hosting for Horizon Launch"
});

console.log(response);
Example:

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

Delete a recurring invoice

DELETE/recurring-invoices/{id}

Soft delete a recurring invoice schedule. The schedule is moved to the trash and can be restored.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

await sdk.recurringInvoices.delete("inv_6595a27b5d35015c3ef0c3fd");

console.log('Deleted successfully');

Permanently delete a recurring invoice

DELETE/recurring-invoices/{id}/permanent

Permanently delete a soft-deleted recurring invoice schedule. Only schedules in the trash can be permanently deleted.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

await sdk.recurringInvoices.permanentDeleteRecurringInvoice("inv_6595a27b5d35015c3ef0c3fd");

console.log('Deleted successfully');

Restore a deleted recurring invoice

POST/recurring-invoices/{id}/restore

Restore a soft-deleted recurring invoice schedule from the trash.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.restoreRecurringInvoice("inv_6595a27b5d35015c3ef0c3fd");

console.log(response);

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

Pause a recurring invoice

POST/recurring-invoices/{id}/pause

Pause an active recurring invoice schedule. No invoices will be generated while paused. The next run date is cleared.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.pauseRecurringInvoice("inv_6595a27b5d35015c3ef0c3fd");

console.log(response);

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

Resume a paused recurring invoice

POST/recurring-invoices/{id}/resume

Resume a paused recurring invoice schedule. The next run date is recalculated from the current date.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.resumeRecurringInvoice("inv_6595a27b5d35015c3ef0c3fd");

console.log(response);

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}

Manually trigger invoice generation

POST/recurring-invoices/{id}/trigger

Manually trigger invoice generation for a recurring invoice schedule. Creates a new invoice immediately using the source document as template.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.recurringInvoices.triggerRecurringInvoice("inv_6595a27b5d35015c3ef0c3fd");

console.log(response);

Returns

idstring
Other parameters
entity_idstring
document_idstring
namestring
frequencystring
intervalinteger
day_of_weekintegernullable
day_of_monthintegernullable
month_of_yearintegernullable
start_datestring
end_datestringnullable
next_run_datestringnullable
last_run_datestringnullable
statusstring
auto_sendboolean
create_as_draftboolean
send_tostringnullable
payment_terms_daysintegernullable
notify_ownerboolean
invoices_generatedinteger
last_generated_invoice_idstringnullable
last_errorstringnullable
last_error_atstring<date-time>nullable
metadatastringnullable
deleted_atstring<date-time>nullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "rinv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "name": "Monthly telemetry hosting for Horizon",
  "frequency": "monthly",
  "interval": 1,
  "day_of_week": null,
  "day_of_month": 1,
  "month_of_year": null,
  "start_date": "2025-02-01",
  "end_date": null,
  "next_run_date": "2025-02-01",
  "last_run_date": null,
  "status": "active",
  "auto_send": false,
  "create_as_draft": false,
  "send_to": null,
  "payment_terms_days": null,
  "notify_owner": true,
  "invoices_generated": 0,
  "last_generated_invoice_id": null,
  "last_error": null,
  "last_error_at": null,
  "metadata": {},
  "created_at": "2025-01-15T00:00:00.000Z",
  "updated_at": "2025-01-15T00:00:00.000Z",
  "deleted_at": null
}