Create Invoice

Create Invoice

Authentication

X-Auth-Tokenstring
### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
X-Store-Hashstring
### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |

Request

invoiceNumberstringRequired
Invoice no.
originalBalanceobjectRequired
Original balance
openBalanceobjectRequired

Open balance , when it is <= 0, status will be auto set to 2

customerIdstringRequired
B2B Edition Company ID
typestringOptionalDefaults to Invoice
Invoice type
dueDateintegerOptional

The due date for this invoice, specified as a Unix timestamp. If left empty, it will be set to the current date plus a pre-configured number of days (set in your B2B Edition control panel settings).

statusenumOptional

Invoice status. Possible values: 0: Open (default) 1: Partially paid 2: Completed

The status will automatically be set to Completed (2) when the open balance becomes zero or negative.

Allowed values:
orderNumberstringOptional
BigCommerce order ID associated with this invoice.
purchaseOrderNumberstringOptional
PO Number
issuedAtdoubleOptional
When the invoice was created. The current timestamp is the default.
detailsobjectOptional
Invoice details
sourceenumOptional

The source of the invoice. Possible values: 0: B2B Edition 1: External

Allowed values:
externalIdstringOptional
ERP Invoice ID
externalCustomerIdstringOptional
ERP Customer ID
channelIdintegerOptional
BigCommerce Channel ID
externalPdfUrlstringOptional

The URL of an externally hosted PDF file to be associated with this invoice. The file size must not exceed 5 MB. Ensure that the file hosting service supports Cross-Origin Resource Sharing (CORS) to allow our system to access the file.

termsConditionsstringOptional

Terms & Conditions. Visible on the default Invoice PDF.

extraFieldslist of objectsOptional

Response

OK
codedouble
200
dataobject
metaobject