Skip to navigation

Create an invoice

Creates a manual invoice as a draft, for a charge outside any order. Order invoices come from their order and can’t be created.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Headers

Paid-BetaenumRequired

This endpoint is in the invoices=v1 beta. Send this header to use it.

Allowed values:

Request

Body
currencystringRequiredformat: "^[a-z]{3}$"

Lowercase ISO 4217 currency code, e.g. usd. Must be enabled on your account.

customerstringRequired1-255 characters

The customer to bill: its cus_ ID, your externalId, or one of its aliases.

lineslist of objectsRequired
The lines, 1 to 250.
billingContactslist of stringsOptional

con_ contacts of the customer who receive it. Defaults to the customer’s billing contacts.

dueAtdatetimeOptional

When payment is due, overriding paymentTerms. Must be on or after now.

metadatamap from strings to stringsOptional

String key-value pairs of your own, up to 500 characters per value. Always updatable.

paymentTermsenumOptional

Defaults to net30.

purchaseOrderNumberstringOptional1-255 characters
Printed on the document.

Response

201
idstring
The invoice's ID.
objectenum

The type of object. Always invoice.

Allowed values:
createdAtdatetime
When the object was created.
amountsobject

Integers in minor units of the invoice’s currency.

billingContactslist of strings

The con_ contacts who receive the invoice.

currencystring

Lowercase ISO 4217 currency code, e.g. usd.

customerstring1-255 characters

The customer billed, as its cus_ ID. For order invoices, the order’s billTo.

documentsobject
Links to the issued invoice. New formats are added as fields here.
dueAtdatetime or null

When payment is due. On a draft it’s projected from paymentTerms; finalizing keeps the same gap from issuedAt.

issuedAtdatetime or null

When it was finalized: the legal issue date.

lineCountinteger

How many lines it has. Read them with invoices.lines.list.

livemodeboolean

true for an object on a live account, false on a test account.

markedUncollectibleAtdatetime or null

When it was written off, or null.

metadatamap from strings to strings

String key-value pairs of your own, up to 500 characters per value. Always updatable.

numberstring or null

The legal number from the account’s sequence, assigned on finalize. null on drafts. Never reused.

orderstring or null1-255 characters

The ord_ order the invoice bills; null on manual ones.

overdueboolean

true when finalized, not paid, something is still owed and dueAt has passed.

paidAtdatetime or null

When paymentStatus became paid, or null.

paymentStatusenum

null on drafts and voided invoices; kept on uncollectible ones, which can still be paid.

Allowed values:
paymentTermsenum

From the order on order invoices; set on manual ones. null when a manual invoice was given only a dueAt.

periodobject

A span of time; endsAt is exclusive.

purchaseOrderNumberstring or null
Printed on the document.
sentAtdatetime or null

The last time it was emailed, or null.

sourceenum

order when the billing run, an activation or an amendment built it from an order, manual when it was created with invoices.create.

Allowed values:
statusenum

draft until finalized, then finalized. uncollectible once written off, voided once voided; voided is final. Payment is paymentStatus, not this. Expect new values.

Allowed values:
taxobject
Tax on the invoice.
updatedAtdatetime
When the object was last changed.
voidedAtdatetime or null

When it was voided, or null.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error