Email the invoice
const url = 'https://api.brrndops.com/v1/invoices/inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11/send';const options = { method: 'POST', headers: { 'Idempotency-Key': '7f1c0f54-3a2b-4d5e-8f9a-0b1c2d3e4f5a', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"to":"hello@example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.brrndops.com/v1/invoices/inv_8f3c0e7e-5d2a-4c1b-9f43-2c1d0a9b7e11/send \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 7f1c0f54-3a2b-4d5e-8f9a-0b1c2d3e4f5a' \ --data '{ "to": "hello@example.com" }'Emails the PDF to customer.email, or to to if given, and moves an open invoice to sent.
Draft invoices must be opened first. In sandbox no email is sent; the status still changes so you can test your flow.
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 Body
Section titled “Request Body”object
Send to this address instead of the customer’s.
Examplegenerated
{ "to": "hello@example.com"}Responses
Section titled “ Responses ”The invoice after sending.
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" }}