Skip to content

API reference

Prepare the next invoice

Invoicing API

POST/v1/recurring-invoices/{id}/drafts

Saves the next invoice as a draft, as POST /v1/invoices/{id}/follow-ups with next makes it: today’s date, a suggested number, and every period moved on. The recurring invoice then moves one interval on.

Path parameters

  • idstring (uuid)Required

Response

A 201 answer carries these fields.

  • draftobjectRequired
    Show 9 child fields
    • idstring (uuid)Required
    • revisionintegerRequired

      Counted up by every save. Send it as If-Match when you save the draft.

    • kindstringRequired
      One of invoice, quote, proforma.
    • titlestring or nullRequired

      The buyer's name and the invoice number, as far as the draft has them.

    • originobject or nullRequired

      The stored invoice a follow-up was made from. Null for a draft written from scratch.

      Show 2 child fields
      • invoiceIdstring (uuid)Required
      • followUpstringRequired
        One of copy, correction, credit, next, final.
    • createdAtstring (date-time)Required
    • updatedAtstring (date-time)Required
    • invoiceobjectRequired
    • settingsobjectRequired
  • scheduleobjectRequired
    Show 10 child fields
    • idstring (uuid)Required
    • sourceobjectRequired

      What repeats: { invoiceId } or { draftId }.

      Show 2 child fields
      • invoiceIdstring (uuid)
      • draftIdstring (uuid)
    • intervalstringRequired
      One of monthly, quarterly, half-yearly, yearly.
    • nextDuestring (date)Required
    • activebooleanRequired
    • preparedintegerRequired

      How many drafts it has prepared.

    • lastDraftIdstring (uuid) or nullRequired
    • duebooleanRequired

      Active and due today or before.

    • createdAtstring (date-time)Required
    • updatedAtstring (date-time)Required

Status codes

Status Meaning
201 The draft and the recurring invoice as it is now.
401
404
409 The recurring invoice is paused (schedule_inactive), or its invoice cannot be read (invoice_has_no_model, invoice_changed_since_check).
501
POST/v1/recurring-invoices/{id}/drafts
Example
curl -X POST https://api.certinvo.com/v1/recurring-invoices/$RECURRING_INVOICE_ID/drafts \
  -H "Authorization: Bearer $CERTINVO_API_KEY"
const recurringInvoiceId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'

const response = await fetch(`https://api.certinvo.com/v1/recurring-invoices/${recurringInvoiceId}/drafts`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
  },
})
console.log(response.status, await response.json())
import os

import requests

recurring_invoice_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"

response = requests.post(
    f"https://api.certinvo.com/v1/recurring-invoices/{recurring_invoice_id}/drafts",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}"},
)
print(response.status_code, response.text)
201
application/json
{
  "draft": {
    "id": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
    "revision": 0,
    "kind": "invoice",
    "title": "string",
    "origin": {
      "invoiceId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
      "followUp": "copy"
    },
    "createdAt": "2026-09-17T09:30:00Z",
    "updatedAt": "2026-09-17T09:30:00Z",
    "invoice": {},
    "settings": {}
  },
  "schedule": {
    "id": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
    "source": {
      "invoiceId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
      "draftId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
    },
    "interval": "monthly",
    "nextDue": "2026-09-17",
    "active": true,
    "prepared": 0,
    "lastDraftId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
    "due": true,
    "createdAt": "2026-09-17T09:30:00Z",
    "updatedAt": "2026-09-17T09:30:00Z"
  }
}
Success response
POST
/v1/recurring-invoices/{id}/drafts
Prepare the next invoice
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Variables1
›Headers2
›Body
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/recurring-invoices/{id}/drafts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close