Recurring document and subscription API for invoice and purchase-order templates, scheduling, activation, pausing, resuming, cancellation, and on-demand generation.
Generated from the Celerp 2.9.0 OpenAPI schema, .
GET/subscriptions
List Recurring Document Templates
Return recurring document templates matching the documented filters and pagination options.
Parameters
Name
In
Required
Type
Description
direction
query
--
string, optional
Sort or schedule direction supported by the subscriptions endpoint.
status
query
--
string, optional
Record or workflow status used to filter results or select the requested lifecycle state.
q
query
--
string, optional
Search text used to filter matching records.
review
query
--
boolean
When true, return only agreements with earlier documents waiting for history review.
limit
query
--
integer
Maximum number of records to return.
offset
query
--
integer
Number of matching records to skip before returning results.
Responses
Status
Description
Body
200
Returns the requested recurring document templates.
object
422
The request failed validation. The response lists each invalid field and why.
HTTPValidationError
Example
curl -X GET http://localhost:8000/subscriptions \
-H "Authorization: Bearer $TOKEN"
GET/subscriptions/catch-up
Catch Up
Unattended agreements further behind than their catch-up window.
Responses
Status
Description
Body
200
Successful Response
object
Example
curl -X GET http://localhost:8000/subscriptions/catch-up \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/catch-up/run
Catch Up Run
Bill the chosen periods from the catch-up preview, in order. An item is billed
only when the preview lists it and it is its agreement's oldest open period. A refused
item says why, the agreement's own state first (paused, cancelled, no schedule) before
that it left the preview, and names its period's dates when the schedule gives them.
Every active agreement with a period due today: what Generate due would bill.
Responses
Status
Description
Body
200
Successful Response
object
Example
curl -X GET http://localhost:8000/subscriptions/due \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/generate-due
Generate All Due
Bill the oldest due period of each listed agreement, each on its own: one
refusal never stops the rest. A period billed before this request counts as
already billed, never as billed.
What unattended billing did: each bill and email of the last 90 days, and each billing failure, lapsed authorization and email waiting to go out while it lasts, each row with the ``key`` Mark as read posts for it (none for a row shown while it lasts): every row but those this user marked read (``all``: every row).
Parameters
Name
In
Required
Type
Description
all
query
--
boolean
When true, return everything unattended billing recorded, not only what came after this user last marked the summary read.
Responses
Status
Description
Body
200
Successful Response
object
422
Validation Error
HTTPValidationError
Example
curl -X GET http://localhost:8000/subscriptions/summary \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/summary/ack
Ack Summary
Mark read the rows the page showed (each row's ``key`` from GET /summary); a key of
no row there now is ignored.
Undo a placement or a set-aside while no later period is billed: the document waits
for review again. On an ENDED agreement a placement is final like a bill, and a set-aside
always goes back.
Parameters
Name
In
Required
Type
Description
entity_id
path
yes
string
Identifier of the requested Celerp record.
doc_id
path
yes
string
Identifier of the earlier document placed in a period or set aside in the agreement's history review.
Responses
Status
Description
Body
200
Successful Response
object
422
Validation Error
HTTPValidationError
Example
curl -X POST http://localhost:8000/subscriptions/:entity_id/history/:doc_id/withdraw \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/{entity_id}/pause
Pause Recurring Document
Pause a recurring document. No documents are generated until it is resumed.
Parameters
Name
In
Required
Type
Description
entity_id
path
yes
string
Identifier of the requested Celerp record.
Responses
Status
Description
Body
200
Returns `ok: true` when the change is saved.
object
422
The request failed validation. The response lists each invalid field and why.
HTTPValidationError
Example
curl -X POST http://localhost:8000/subscriptions/:entity_id/pause \
-H "Authorization: Bearer $TOKEN"
GET/subscriptions/{entity_id}/periods
List Periods
The agreement's periods, newest first, and its next bill date.
Parameters
Name
In
Required
Type
Description
entity_id
path
yes
string
Identifier of the requested Celerp record.
before
query
--
integer, optional
Return periods before this period index.
Responses
Status
Description
Body
200
Successful Response
object
422
Validation Error
HTTPValidationError
Example
curl -X GET http://localhost:8000/subscriptions/:entity_id/periods \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/{entity_id}/periods/{k}/reopen
Reopen Period
Open a billed period again once its document no longer bills it (void, or back in
draft), so it can be billed once more. Unvoiding or finalizing that document undoes it
while no newer bill bills the period (billing.guard_bill_status).
Parameters
Name
In
Required
Type
Description
entity_id
path
yes
string
Identifier of the requested Celerp record.
k
path
yes
integer
Index of the billing period: 0 is the period starting on the first bill date, and each later period counts up by one.
Responses
Status
Description
Body
200
Successful Response
object
422
Validation Error
HTTPValidationError
Example
curl -X POST http://localhost:8000/subscriptions/:entity_id/periods/:k/reopen \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/{entity_id}/periods/{k}/send
Send Period
Send period ``k``'s document again after a failed or cut-off send (``again``: a new
message for one that may already have arrived). ``attempt`` is the stored attempt the
user saw, so the same click arriving twice sends once; answered with how its email reads now.
Parameters
Name
In
Required
Type
Description
entity_id
path
yes
string
Identifier of the requested Celerp record.
k
path
yes
integer
Index of the billing period: 0 is the period starting on the first bill date, and each later period counts up by one.
Index of the billing period: 0 is the period starting on the first bill date, and each later period counts up by one.
Responses
Status
Description
Body
200
Successful Response
object
422
Validation Error
HTTPValidationError
Example
curl -X POST http://localhost:8000/subscriptions/:entity_id/periods/:k/unskip \
-H "Authorization: Bearer $TOKEN"
POST/subscriptions/{entity_id}/resume
Resume Recurring Document
Resume a paused recurring document and schedule its next run.
Parameters
Name
In
Required
Type
Description
entity_id
path
yes
string
Identifier of the requested Celerp record.
Responses
Status
Description
Body
200
Returns `ok: true` and the next date a document will be generated.
object
422
The request failed validation. The response lists each invalid field and why.
HTTPValidationError
Example
curl -X POST http://localhost:8000/subscriptions/:entity_id/resume \
-H "Authorization: Bearer $TOKEN"
PATCH/subscriptions/{entity_id}/schedule
Change Schedule
Change the agreement's schedule terms and unattended modes. Bringing a mode into
force, or changing the terms of one that runs, asks for its consent where every
agreement write does (billing.write_agreement). Choosing automatic billing asks the bill
path first (billing.bill_refusal).