Update an invoice
const url = 'https://api.brrndops.com/v1/invoices/inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11';const options = { method: 'PATCH', headers: { 'Idempotency-Key': '7f1c0f54-3a2b-4d5e-8f9a-0b1c2d3e4f5a', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"status":"paid"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.brrndops.com/v1/invoices/inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 7f1c0f54-3a2b-4d5e-8f9a-0b1c2d3e4f5a' \ --data '{ "status": "paid" }'Updates only the fields you send. Sending line_items replaces all line items.
In metadata, set a key to "" to remove it.
Status can move draft → open → sent → paid (and open → paid). Use DELETE to delete,
and POST /invoices/{id}/send to email it. Changing currency requires sending line_items too.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Example
inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11Header Parameters
Section titled “Header Parameters”Example
7f1c0f54-3a2b-4d5e-8f9a-0b1c2d3e4f5aA unique string (1–255 printable ASCII characters) that makes retries safe.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Must be unique in the account. Leave out to auto-number.
ISO 4217. Three-decimal currencies (KWD, BHD…) aren’t supported.
Who you’re billing. name is required on create.
object
ISO 3166-1 alpha-2
Who the invoice is from. Defaults to your business details.
object
ISO 3166-1 alpha-2
object
Price per unit in minor units.
At most two decimal places.
Defaults to today (UTC).
Defaults to issue_date.
Bank or payment instructions printed on the invoice (max 8KB).
object
Must be https.
Your own ID for this invoice; filter lists by it.
Up to 50 keys of your own data.
object
Example
{ "status": "paid"}Responses
Section titled “ Responses ”The updated invoice.
object
object
ISO 3166-1 alpha-2
object
ISO 3166-1 alpha-2
object
Quantity × unit_amount.
Subtotal + tax_amount − discount_amount.
object
Must be https.
object
Example
{ "id": "inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11", "object": "invoice", "number": "INV-001", "status": "draft", "customer": { "country_code": "NG" }, "issuer": { "country_code": "NG" }, "line_items": [ { "id": "li_…", "object": "line_item" } ], "branding": { "primary_color": "#2388ff", "secondary_color": "#f7f8fc" }}The request was invalid: a missing or malformed field (param says which), an unknown field, or a rule such as a disallowed status change.
object
object
The request field the error relates to.
Example
{ "error": { "type": "authentication_error", "code": "parameter_missing" }}Missing, invalid, expired or revoked API key.
object
object
The request field the error relates to.
Example
{ "error": { "type": "authentication_error", "code": "parameter_missing" }}The key lacks the required scope (insufficient_scope), or the business isn’t verified yet (account_not_verified, production keys only).
object
object
The request field the error relates to.
Example
{ "error": { "type": "authentication_error", "code": "parameter_missing" }}No such resource in this account and environment.
object
object
The request field the error relates to.
Example
{ "error": { "type": "authentication_error", "code": "parameter_missing" }}invoice_number_taken, or request_in_progress when a request with the same Idempotency-Key is still running.
object
object
The request field the error relates to.
Example
{ "error": { "type": "authentication_error", "code": "parameter_missing" }}The Idempotency-Key was already used with a different request.
object
object
The request field the error relates to.
Example
{ "error": { "type": "authentication_error", "code": "parameter_missing" }}