Skip to main content
POST
Create an invoice

Authorizations

X-API-KEY
string
header
required

Body

application/json

Invoice to create

clientId
string

ClientID is the client the invoice is billed to. Exactly one of clientId, companyId, or recipientId must be provided.

Example:

"client_a1b2c3d4e5f6"

collectionMethod
enum<string>

CollectionMethod is how the invoice is collected.

Available options:
sendInvoice,
chargeAutomatically,
paymentLink
Example:

"sendInvoice"

companyId
string

CompanyID is the company the invoice is billed to. Exactly one of clientId, companyId, or recipientId must be provided.

Example:

"company_a1b2c3d4e5f6"

currency
string

Currency is the ISO currency code.

Example:

"usd"

daysUntilDue
integer

DaysUntilDue sets the due date relative to creation, as an alternative to dueDate.

Example:

14

dueDate
string<date-time>

DueDate is the date the invoice is due.

Example:

"2024-03-01T00:00:00Z"

lineItems
object[]

LineItems are the invoice line items. Required unless templateId is provided, in which case the template's line items are used when omitted. Must contain at least one item when provided.

Minimum array length: 1
memo
string

Memo is an optional note shown on the invoice.

Example:

"Thanks for your business"

paymentMethodPreferences
object[]

PaymentMethodPreferences restricts which payment methods are offered.

recipientId
string

RecipientID is the recipient (client or company) of the invoice. Exactly one of clientId, companyId, or recipientId must be provided.

Example:

"client_a1b2c3d4e5f6"

subscriptionId
string

SubscriptionID optionally associates the invoice with a subscription.

Example:

"sub_a1b2c3d4e5f6"

taxPercentage
number

TaxPercentage is an optional tax rate applied to the invoice.

Example:

8.5

templateId
string

TemplateID optionally seeds the invoice from an invoice template.

Example:

"itmpl_a1b2c3d4e5f6"

Response

OK

address
object

Address stores the selected billing address from custom fields

amountPaid
integer

AmountPaid is the amount paid so far in the smallest currency unit (e.g. cents).

attachmentKeys
string[]

AttachmentKeys are the storage keys of the invoice attachments.

attachmentUrls
string[]

AttachmentUrls are presigned download URLs for the invoice attachments.

billingReason
string

BillingReason describes why the invoice was created (e.g. manual, subscription cycle).

Example:

"manual"

clientId
string

ClientID is the ID of the client the invoice is billed to.

Example:

"client_a1b2c3d4e5f6"

collectionMethod
enum<string>

CollectionMethod controls how the invoice is collected.

Available options:
sendInvoice,
chargeAutomatically,
paymentLink
Example:

"sendInvoice"

companyId
string

CompanyID is the ID of the company the invoice is billed to.

Example:

"company_a1b2c3d4e5f6"

createdAt
string
creatorId
string
currency
string

Currency is the ISO 4217 currency code the invoice is denominated in.

Example:

"usd"

data
string
daysUntilDue
integer

DaysUntilDue is the number of days from issuance until the invoice is due.

Example:

14

dueDate
string<date-time> | null

DueDate is the RFC 3339 timestamp by which the invoice must be paid.

Example:

"2024-03-01T00:00:00Z"

entityType
string

ObjectType is the internal entity type discriminator.

fileKey
string

FileKey is the storage key of the invoice PDF.

fileUrl
string

FileUrl is the presigned download URL for the invoice PDF.

id
string
identityId
string
interval
string

Property copied from subscription when creating invoice We need this value when we have to show line items descriptions (Format "Item (at US$621.00 / month)") on invoice details for subscriptions invoices. We can fetch this directly from subscription at that time, but we delete subscriptions when we delete the recipient (client/company). For deleted recipients we still show invoices which were paid in the past. So we need to store this value here to show line items descriptions for invoices even if subscriptions are deleted.

invoiceCreationStatus
enum<string>
Available options:
ephemeral,
pending,
created
latestRefundStatus
enum<string>

LatestRefundStatus is the status of the most recent refund issued against the invoice, when any.

Available options:
pending,
succeeded,
failed
Example:

"succeeded"

lineItems
object[]

LineItems are the priced line items that make up the invoice.

memo
string

Memo is an optional note shown to the recipient on the invoice.

Example:

"Thanks for your business"

number
string

Number is the human-readable invoice number.

Example:

"INV-0001"

object
string
origin
enum<string>

Origin indicates how the invoice was created.

Available options:
internal,
payment_link,
product_store
Example:

"internal"

paidManually
boolean
payment
object[]

represents the successful payments only

paymentMethodPreferences
object[]

field is only used for platform api and should not be used anywhere else on FE/BE

paymentPreferences
object

fields is used for BE/FE only

paymentSourceId
string
paymentSuccessDate
string<date-time>

PaymentSuccessDate is the RFC 3339 timestamp at which payment succeeded; absent until paid.

Example:

"2024-02-20T14:05:00Z"

portalId
string

PortalID is the ID of the portal the invoice belongs to.

previousAttributes
object
quickBooksData
object
receiptKey
string
receiptNumber
string

ReceiptNumber is the human-readable receipt number, set once the invoice is paid.

Example:

"REC-0001"

receiptUrl
string

ReceiptUrl is the presigned download URL for the receipt PDF.

recipientId
string

Deprecated: use ClientID and CompanyID instead

Example:

"client_a1b2c3d4e5f6"

ref
string
sentDate
string<date-time> | null

SentDate is the RFC 3339 timestamp at which the invoice was sent to the recipient.

Example:

"2024-02-15T09:00:00Z"

SourcePaymentLinkId is the ID of the payment link that produced this invoice, when applicable.

Example:

"plink_a1b2c3d4e5f6"

status
enum<string>

Status is the current lifecycle state of the invoice.

Available options:
draft,
open,
void,
paid,
processing
Example:

"open"

subscription
object

Subscription is populated from search results when subscriptionId is present (not persisted)

subscriptionId
string

SubscriptionID is the ID of the subscription that generated this invoice, when applicable.

Example:

"sub_a1b2c3d4e5f6"

taxAmount
integer

TaxAmount is the computed tax in the smallest currency unit (e.g. cents).

Example:

1275

taxPercentage
number | null

TaxPercentage is the tax rate applied to the invoice, expressed as a percentage.

Example:

8.5

templateId
string

TemplateID is the ID of the invoice template the invoice was created from, when applicable.

Example:

"itmpl_a1b2c3d4e5f6"

total
integer

Total is the invoice total in the smallest currency unit (e.g. cents).

Example:

15000

updatedAt
string