Skip to content

Invoice routes: update

The Invoice Verbs update as api.sb routes, with inputs, result, refusals and an example.

Reference for Invoice, one group of Invoice routes.

Invoice.update

Changes the given properties of an Invoice. Verb page.

Text
PATCH /{namespace}/invoices/{id}

Path: id. Body, as JSON: the other inputs. Emits Invoice.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Invoice.
totalmoneyThe amount due.
duedateWhen payment is due.
paidAtdatetimeWhen it was paid.
collectionstringcharge charges the saved payment method; send sends the Invoice and waits for a transfer. charge by default.
termsintegerDays from issue until a send Invoice is due, such as 30; sets due.
purchaseOrderstringThe Customer’s purchase order number, printed on the Invoice.
refundedmoneyThe total returned to the Customer, from zero up to the amount paid.
numberstringThe Invoice number, sequential per Startup and never reused, voided Invoices included.
linesjsonEach Offer billed: its quantity, Period and amount, with any Coupon or Credit Grant applied.
pdfurlThe Invoice, or its receipt once paid, as a PDF on the Startup’s Domain that names the seller of record.
payUrlurlThe page on the Startup’s Domain where the Customer pays it by card or bank transfer.

Returns

OutputTypeRequiredDescription
invoiceInvoicerequiredThe Invoice.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X PATCH https://api.sb/leaseline.app/invoices/inv_9sfvgeRT7L \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"total":{"amount":29,"currency":"USD"}}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "invoice": {
    "$id": "https://api.sb/leaseline.app/invoices/inv_9sfvgeRT7L",
    "$type": "Invoice",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "due": "2026-10-01"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Invoice.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}