Skip to main content
PATCH
/
recurring-invoices
/
{id}
Edit recurring invoice schedule
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    memo: '<string>',
    autoSend: true,
    totalOccurrences: 123,
    startDate: '2023-11-07T05:31:56Z',
    lineItems: [
      {
        productId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
        quantity: 123,
        taxRateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
        unitPriceOverride: 123
      }
    ]
  })
};

fetch('https://api.dolfinai.co/recurring-invoices/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "currency": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "memo": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "totalOccurrences": 123,
  "occurrencesGenerated": 123,
  "nextRunAt": "2023-11-07T05:31:56Z",
  "autoSend": true,
  "lastGeneratedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "customer": {
    "name": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "email": "<string>",
    "phone": "<string>",
    "taxNumber": "<string>",
    "addressLine1": "<string>",
    "addressLine2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "postalCode": "<string>",
    "country": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "updatedAt": "2023-11-07T05:31:56Z",
    "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "lineItems": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "productName": "<string>",
      "quantity": 123,
      "taxRateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "unitPriceOverride": 123
    }
  ]
}

Path Parameters

id
string<uuid>
required

Body

application/json
memo
null | string
autoSend
null | boolean
totalOccurrences

Must be at least the number of occurrences already generated. Setting it equal completes the schedule.

startDate
null | string<date-time>

Only editable before the first invoice is generated.

cadence
null | enum<string>

Only editable before the first invoice is generated.

Available options:
Weekly,
Monthly,
Quarterly,
Annually
lineItems
null | object[]

Full replacement of the line-item templates. Affects future occurrences only.

Response

OK

currency
string
required

ISO 4217 currency code (e.g. GBP, USD, EUR)

id
string<uuid>
organisationId
string<uuid>
customerId
string<uuid>
memo
null | string
startDate
string<date-time>
cadence
enum<string>
Available options:
Weekly,
Monthly,
Quarterly,
Annually
totalOccurrences
occurrencesGenerated
nextRunAt
null | string<date-time>

When the next invoice will be generated. Null on Paused, Completed, and Cancelled schedules.

autoSend
boolean
status
enum<string>
Available options:
Active,
Paused,
Completed,
Cancelled
lastGeneratedAt
null | string<date-time>
createdAt
string<date-time>
createdBy
null | string<uuid>
updatedAt
string<date-time>
updatedBy
null | string<uuid>
customer
null | object
lineItems
object[]