v1

latestOpenAPI 3.1.02026-07-24770322.0 KB

Create Invoice

This API endpoint create an invoice and automatically assigns it to given recipient to pay

post/v1/invoices

Request body

templateIdstring

Unique ID of the invoice template to use. If provided, template values will be used for lineItems, memo, and taxPercentage.

recipientIdstring

Deprecated in favor of clientId and companyId.

memostring

Memo (arbitrary string) attached to the invoice, often used for display.

daysUntilDueinteger required

The number of days from when the invoice is created until it is due. Max value is 30.

taxPercentagenumber float

Tax percentage to apply to the invoice amount.

clientIdstring

The ID of the client this invoice is assigned to. Leave empty if assigning to a company.

companyIdstring

The ID of the company this invoice is assigned. This is required when an invoice is assigned to a client with more than one company.

Response

200

idstring
objectstring
recipientIdstring
clientIdstring
companyIdstring
statusstring
memostring
taxPercentagenumber
currencystring
totalinteger
taxAmountinteger
dueDatestring
sentDatestring
paymentSuccessDatestring
numberstring
fileUrlstring
receiptNumberstring
receiptUrlstring
billingReasonstring
createdAtstring
updatedAtstring

Example response

{
  "id": "a6e8a5ea-9fb1-488b-a4a8-86697943bdb3",
  "object": "invoice",
  "recipientId": "a6e8a5ea-9fb1-488b-a4a8-86697943bdb4",
  "clientId": "a6e8a5ea-9fb1-488b-a4a8-86697943bdb4",
  "companyId": "a6e8a5ea-9fb1-488b-a4a8-86697943bdb4",
  "status": "open",
  "memo": "this invoice has a product and one off item.",
  "taxPercentage": 4.5,
  "currency": "USD",
  "lineItems": [
    {
      "amount": 1000,
      "description": "item a",
      "quantity": 3
    }
  ],
  "total": 103000,
  "taxAmount": 4635,
  "dueDate": "2024-07-12T21:31:16.789Z",
  "sentDate": "2024-07-12T21:31:16.789Z",
  "paymentSuccessDate": "2024-07-12T21:31:16.789Z",
  "number": "INV-0001",
  "paymentMethodPreferences": [
    {
      "type": "creditCard"
    }
  ],
  "fileUrl": "https://example.com/invoice.pdf",
  "receiptNumber": "INV-0001",
  "receiptUrl": "https://example.com/receipt.pdf",
  "billingReason": "manual",
  "createdAt": "2024-02-21T15:31:16.789Z"
}