Skip to main content
POST
/
invoices
Create standalone invoice
curl --request POST \
  --url https://api.salesbricks.com/api/v2/invoices \
  --header 'Content-Type: application/json' \
  --header 'X-SALESBRICKS-KEY: <api-key>' \
  --data '
{
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "due_at": "2023-12-25",
  "line_items": "<string>",
  "accounts_payable_emails": [
    "jsmith@example.com"
  ],
  "issued_at": "2023-12-25",
  "invoice_memo": "<string>",
  "purchase_order": "<string>",
  "send_invoice": false,
  "pdf_attachments": [
    "<string>"
  ],
  "pdf_attachments_config": [
    {}
  ],
  "auto_pay_invoice": false,
  "dunning_auto_retries": true,
  "adjustments": [],
  "starts_at": "2023-12-25",
  "ends_at": "2023-12-25"
}
'
{
  "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "invoice_number": "<string>",
  "amount": 123,
  "currency": "<string>",
  "status": "<string>",
  "due_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.salesbricks.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Body

Input serializer for POST /api/v2/invoices.

customer_id
string<uuid>
required

The unique identifier of the customer to whom the invoice is being sent

due_at
string<date>
required

The date on which the invoice is due

currency
enum<string>
required

Optional currency to be used for the subscription. Defaults to USD.

  • USD - United States Dollar
  • EUR - Euros
  • GBP - Great British Pound
  • AUD - Australian Dollar
  • CAD - Canadian Dollar
  • INR - Indian Rupee
Available options:
USD,
EUR,
GBP,
AUD,
CAD,
INR
line_items
string
required

The line items to be included on the invoice

accounts_payable_emails
string<email>[]
required

List of accounts payable contact emails for the invoice

issued_at
string<date> | null

The date on which this invoice was issued. Defaults to today.

invoice_memo
string

Optional memo or notes to be included on the invoice

Maximum string length: 2000
purchase_order
string

Optional purchase order number to be included on the invoice

send_invoice
boolean
default:false

Whether to send the invoice to the customer after creating it

pdf_attachments
string<uri>[]

PDF files to attach to the invoice

pdf_attachments_config
object[]

Configuration for managing attachments. Each item specifies a new file to add (by new_file_index) or a terms document to attach (by terms_document_id). The order in this array determines the unified order of attachments in the PDF. If omitted, pdf_attachments are attached in upload order.

charge_timing
enum<string> | null

('Decides wether to charge when this invoice is issued or when it is due if auto-pay is enabled. ', 'ISSUE_DATE - Charge when the invoice is issued. ', 'DUE_DATE - Charge when the invoice is due if auto-pay is enabled.')

  • ISSUE_DATE - Charge on issue date
  • DUE_DATE - Charge on due date
  • ORDER_FORM_ONLY_DUE_DATE - Charge on due date (order form only)
Available options:
ISSUE_DATE,
DUE_DATE,
ORDER_FORM_ONLY_DUE_DATE,
,
null
auto_pay_invoice
boolean
default:false

('Whether to enable auto pay when the invoice is generated. This gives ability to auto-charge the ', "invoice when there's a saved payment method to be used. Defaults to False.")

dunning_auto_retries
boolean | null

Whether to enable automatic retries for failed payments. When enabled, failed invoice payments will be retried using saved payment methods. Defaults to False.

adjustments
object[]

Optional adjustments to be included on the invoice

starts_at
string<date> | null

Optional service period start date. Defaults to today's date if not provided.

ends_at
string<date> | null

Optional service period end date. Defaults to today's date + 1 month if not provided.

Response

Response serializer for POST /api/v2/invoices.

invoice_id
string<uuid>
required

The unique identifier of the created invoice

invoice_number
string
required

Short form identifier for the invoice.

amount
integer
required

The total amount to be charged for this invoice.

currency
string
required

The currency in which the invoice is denominated (e.g., USD, EUR).

status
string
required

Current status of the invoice (e.g., PENDING, PAID, MUTED).

due_at
string<date-time>
required

The date on which this invoice is expected to be paid by.