For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
      • Storefront
      • Management
        • Overview
          • Addresses
          • Authentication
          • Channels
          • Company
          • Invoice Management
              • GETGet Invoice Detail
              • PUTUpdate Invoice
              • DELDelete Invoice
              • GETList Invoices
              • POSTCreate Invoice
              • POSTCreate Invoice from Order
              • GETDownload Invoice PDF
              • GETGet Invoice Extra Field Configs
          • Orders
          • Payment
          • Quotes
          • Sales Staff
          • Shopping List
          • Super Admin
          • Users
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTB2BManagementInvoice ManagementInvoice

Create Invoice

POST
https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices
POST
/api/v3/io/ip/invoices
$curl -X POST https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "invoiceNumber": "0000001",
> "originalBalance": {
> "code": "USD",
> "value": 100
> },
> "openBalance": {
> "code": "USD",
> "value": 100
> },
> "customerId": "12345",
> "dueDate": 1619161808,
> "status": 0,
> "issuedAt": 1619161808,
> "details": {
> "header": {
> "costLines": [
> {
> "amount": {
> "code": "USD",
> "value": "90.00"
> },
> "description": "Subtotal"
> },
> {
> "amount": {
> "code": "USD",
> "value": "10.00"
> },
> "description": "Freight"
> },
> {
> "amount": {
> "code": "USD",
> "value": "0.00"
> },
> "description": "Sales Tax"
> }
> ],
> "billingAddress": {
> "city": "Chengdu",
> "state": "Sichuan",
> "country": "China",
> "street1": "TianFuWuJie",
> "street2": "",
> "zipCode": "12345",
> "lastName": "Test",
> "firstName": "B2B"
> },
> "shippingAddresses": [
> {
> "city": "Chengdu",
> "state": "Sichuan",
> "country": "China",
> "street1": "TianFuWuJie",
> "street2": "",
> "zipCode": "12345",
> "lastName": "Test",
> "firstName": "B2B"
> }
> ]
> },
> "details": {
> "lineItems": [
> {
> "sku": "Test-1",
> "quantity": "2",
> "unitPrice": {
> "code": "USD",
> "value": "40.00"
> },
> "description": "A custom product requires a description."
> }
> ]
> }
> },
> "channelId": 1
>}'
200Create an invoice
1{
2 "code": 200,
3 "data": {
4 "id": 12
5 },
6 "meta": {
7 "message": "Success"
8 }
9}
Create Invoice
Was this page helpful?
Previous

List Invoices

Next

Create Invoice from Order

Built with

Authentication

X-Auth-Tokenstring
| 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-fundamentals/api-accounts). | For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/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
| 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).

statusenumOptionalDefaults to 0

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
sourceenumOptionalDefaults to 0

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
HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.

HeaderArgumentDescription
X-Store-Hashstore_hashThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.