SoftSolzSoftSolz
HomeAPI GuideAPI ReferenceWidget Tester
invoicing

Update a draft invoice. Only draft invoices can be edited.

Update a draft invoice. Only draft invoices can be edited.

PUThttps://staging.softsolz.uk/api/v1/services/invoicing/invoices/{id}

Recent Requests

Log in to see full request history
TimeStatusUser Agent
Make a request to see history.

Path Params

idstringrequired

Headers

Authorizationstringrequired

Bearer token: `Bearer sk_live_...` (or `sk_test_...` for sandbox). A login token will not work here.

Body Params

customer_idinteger

Active customer id in this tenant.

linesarray of objects

Line items (at least one).

issue_datestring

Issue date; defaults to today (UTC).

due_datestring

Due date; defaults to issue_date + customer terms.

currencystring

3-letter currency; defaults to the customer currency or USD.

discountnumber

Flat discount applied after tax (default 0).

shipping_amountnumber

Shipping added after tax+discount (default 0).

header_tax_rate_pctnumber | null

When set, total tax = subtotal * pct/100 and per-line tax is ignored.

po_numberstring | null

PO number; omit to auto-allocate per customer.

notesstring | null

Notes shown on the invoice.

termsstring | null

Payment terms text.

payment_methodstring | null

Payment path; "stripe" makes the invoice online-payable.

Response

Response Body

idintegerInvoice id.
customer_idintegerCustomer id.
invoice_numberstringHuman invoice number.
issue_datestringIssue date (YYYY-MM-DD).
due_datestringDue date (YYYY-MM-DD).
currencystringISO 4217 currency code.
subtotalstringDecimal amount as a numeric string (NOT minor units).
tax_totalstringTotal tax, numeric string.
totalstringInvoice total, numeric string.
amount_paidstringAmount paid so far, numeric string.
statusstringInvoice status.
linesarray of objectsInvoice line items.
paymentsarray of objectsRecorded payments; payments[].id is the payment_id used when issuing a refund.
created_atstringCreation timestamp.
updated_atstringLast update timestamp.

Request

import { SoftSolz } from '@softsolz/sdk';
const client = new SoftSolz({ apiKey: process.env.SOFTSOLZ_API_KEY });
const result = await client.invoicing.updateInvoice('<id>', {});
console.log(result);

Credentials

Sent as a Bearer token. Stored only in your browser.

Response · 200

{
"data": {
"id": 0,
"customer_id": 0,
"invoice_number": "string",
"issue_date": "string",
"due_date": "string",
"currency": "string",
"subtotal": "string",
"tax_total": "string",
"total": "string",
"amount_paid": "string",
"status": "string",
"lines": [],
"payments": [],
"created_at": "string",
"updated_at": "string"
}
}