Invoice
Get invoice detail
GET https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/{invoiceId}Request
get invoice detail
Authentication
- authToken in header
Parameters
- invoiceId in path - stringrequiredinvoice id
example
curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/[invoiceId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'
Response
OK
Body
object | application/json
codenumber
dataobject
Extra Field ValuesExample: {"extraFields":[{"fieldName":"string","fieldValue":"string"}]}
200
{
"code": 200,
"data": {
"id": 9,
"customerId": "95075",
"externalId": "23",
"externalCustomerId": "123",
"invoiceNumber": "00000009",
"type": "Invoice on Shipment",
"dueDate": 1617675497,
"status": 1,
"orderNumber": "104",
"purchaseOrderNumber": "123",
"details": {
"type": "StandardInvoiceDetails",
"header": {
"costLines": [
{
"amount": {
"code": "USD",
"value": "349.5000"
},
"description": "Subtotal"
},
{
"amount": {
"code": "USD",
"value": "0.0000"
},
example-1
{
"code": 0,
"data": {
"id": 0,
"customerId": "string",
"externalCustomerId": "string",
"externalId": "string",
"invoiceNumber": "string",
"type": "string",
"dueDate": 0,
"status": 0,
"orderNumber": "string",
"purchaseOrderNumber": "string",
"details": {
"type": "string",
"header": {
"costLines": [
{
"amount": {
"code": "string",
"value": "string"
},
"description": "string"
}
],
"orderDate": 0,
"billingAddress": {
"city": "string",
"state": "string",
"country": "string",
Update an invoice
PUT https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/{invoiceId}Request
update an invoice
Authentication
- authToken in header
Parameters
- invoiceId in path - stringrequiredinvoice id
Body
object | application/json
customerIdstring
B2B Edition Company ID>= 1 charactersexternalCustomerIdstring
Ext Customer ID>= 1 charactersexternalIdstring
Ext Invoice ID>= 1 charactersinvoiceNumberstring
Invoice Number, must be unique>= 1 characterstypestring
>= 1 charactersdueDatenumber
Invoice due datestatusnumber
invoice status, noted status will be auto set to 2 when open balance is <= 0purchaseOrderNumberstring
PO Number>= 1 charactersdetailsobject
Details that will show on the invoice. When updating this field, the new value will completely replace the existing details. To preserve existing details while making updates, retrieve the current details first, and make your edits to that object before submitting the changes.sourcenumber
Mark the source of the invoice, 0 for B2B Edition, 1 for external.originalBalanceobject
Invoice original balanceopenBalanceobject
Invoice balance awaiting for paymentcreatedAtinteger
externalPdfUrlstring
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. To remove an existing PDF link, use an empty string.extraFieldsarray[object]
Update body with details field
{
"customerId": "3",
"dueDate": 1619826907,
"details": {
"header": {
"costLines": [
{
"amount": {
"code": "USD",
"value": "400.0000"
},
"description": "Subtotal"
},
{
"amount": {
"code": "USD",
"value": "0.0000"
},
"description": "Freight"
},
{
"amount": {
"code": "USD",
"value": "0.0000"
},
"description": "Sales Tax"
}
]
},
"details": {
"lineItems": [
{
Update body without details field
{
"openBalance": {
"code": "USD",
"value": "12.0000"
}
}
Response
OK
Body
object | application/json
codenumber
requireddataobject
required
200
{
"code": 200,
"data": {
"id": 33
},
"meta": {
"message": "SUCCESS"
}
}
400
{
"code": 400,
"meta": {
"message": "Bad Requests Error",
"errors": "Please enter a valid number; "
},
"data": {
"id": 33
}
}
Delete an invoice
DELETE https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/{invoiceId}Request
delete an invoice
Authentication
- authToken in header
Parameters
- invoiceId in path - stringrequiredinvoice id
example
curl --request DELETE \
--url 'https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/[invoiceId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'
Response
OK
Body
object | application/json
codenumber
requireddataobject
required
200
{
"code": 200,
"data": {
"id": 12
},
"meta": {
"message": "Success"
}
}
Create Invoice
POST https://api-b2b.bigcommerce.com/api/v3/io/ip/invoicesRequest
Create Invoice
Authentication
- authToken in header
Body
object | application/json
Extra Field Values
invoiceNumberstring
requiredInvoice no.typestring
Invoice typeDefault: Invoice
dueDateinteger
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).statusinteger
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: 0 | 1 | 2
Default: 0
orderNumberstring
BigCommerce order ID associated with this invoice.purchaseOrderNumberstring
PO NumberoriginalBalanceobject
requiredOriginal balanceopenBalanceobject
requiredOpen balance , when it is <= 0, status will be auto set to 2issuedAtnumber
When the invoice was created. The current timestamp is the default.detailsobject
Invoice detailssourcenumber
The source of the invoice. Possible values: 0: B2B Edition 1: External
Allowed: 0 | 1
Default: 0
customerIdstring
requiredB2B Edition Company IDexternalIdstring
ERP Invoice IDexternalCustomerIdstring
ERP Customer IDchannelIdinteger
BigCommerce Channel IDexternalPdfUrlstring
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.termsConditionsstring
Terms & Conditions. Visible on the default Invoice PDF.extraFieldsarray[object]
Invoice body with details info
{
"invoiceNumber": "0000001",
"dueDate": 1619161808,
"status": 0,
"originalBalance": {
"code": "USD",
"value": 100
},
"openBalance": {
"code": "USD",
"value": 100
},
"issuedAt": 1619161808,
"details": {
"header": {
"costLines": [
{
"amount": {
"code": "USD",
"value": "90.00"
},
"description": "Subtotal"
},
{
"amount": {
"code": "USD",
"value": "10.00"
},
"description": "Freight"
},
{
"amount": {
"code": "USD",
Invoice body without details info
{
"invoiceNumber": "0000001",
"originalBalance": {
"code": "USD",
"value": 100
},
"openBalance": {
"code": "USD",
"value": 100
},
"customerId": "12345",
"channelId": 1
}
Response
OK
Body
object | application/json
codenumber
200dataobject
200
{
"code": 200,
"data": {
"id": 12
},
"meta": {
"message": "Success"
}
}
400
{
"code": 400,
"data": {
"errMsg": "The invoice number already exists."
},
"meta": {
"message": "Bad Requests Error"
}
}
Get invoices
GET https://api-b2b.bigcommerce.com/api/v3/io/ip/invoicesRequest
get invoices
Authentication
- authToken in header
Parameters
- offset in query - number
- limit in query - number
- orderBy in query - string"DESC" or "ASC"Example: DESC
Allowed: DESC | ASC
- sortBy in query - stringSort by the field valueExample: invoiceNumber
Allowed: invoiceNumber | createdAt | customerId | externalCustomerId | dueDate | updatedAt | isPendingPayment | openBalance | originalBalance | status
- searchBy in query - stringFilter by a fieldExample: invoiceNumber
Allowed: invoiceNumber | type | orderNumber | purchaseOrderNumber | customerId | externalCustomerId
- q in query - stringYou can perform keyword queries on fields corresponding to the value of "searchBy" or, if "searchBy" is empty, on all fields supported by "searchBy".
- customerName in query - stringQuery by invoice B2B Edition company name
- customerId in query - stringQuery by invoice B2B Edition company ID
- status in query - integerQuery by invoice statusExample: 1
Allowed: 0 | 1 | 2
- beginDateAt in query - stringQuery by the created timestamp, along with the "endDateAt" parameter
- endDateAt in query - stringQuery by the created timestamp, along with the with the "beginDateAt" parameter
- externalId[] in query - arrayQuery by the invoice external IDType: array[number]
- isIncludeExtraFields in query - stringDetermine if extra fields should show in the response
Allowed: 0 | 1
- channelIds in query - arrayBigCommerce Channel IDsType: array[number]
example
curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'
Response
OK
Body
object | application/json
codenumber
dataarray[object]
example
{
"code": 200,
"data": [
{
"id": 33,
"customerId": "3",
"externalId": "123",
"externalCustomerId": "123",
"invoiceNumber": "00000033",
"type": "Invoice on Shipment",
"dueDate": 1619826907,
"status": 0,
"orderNumber": "132",
"purchaseOrderNumber": "123",
"details": {
"type": "StandardInvoiceDetails",
"header": {
"costLines": [
{
"amount": {
"code": "USD",
"value": "400.0000"
},
"description": "Subtotal"
},
{
"amount": {
"code": "USD",
Create invoice from order
POST https://api-b2b.bigcommerce.com/api/v3/io/ip/orders/{orderId}/invoicesRequest
create invoice from B2B Edition order
Authentication
- authToken in header
Parameters
- orderId in path - numberrequiredB2B Edition order ID
Response
OK
Body
object | application/json
codenumber
requireddataobject
required
200
{
"code": 200,
"data": {
"invoiceNumber": "00000036",
"invoiceId": 36
},
"meta": {
"message": "SUCCESS"
}
}
404
{
"code": 404,
"data": {
"invoiceId": 36,
"invoiceNumber": "00000036",
"errMsg": "Order does not exist"
},
"meta": {
"message": "Not Found Error"
}
}
invoice download pdf
GET https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/{invoiceId}/download-pdfRequest
Get invoice download PDF
Authentication
- authToken in header
Parameters
- invoiceId in path - stringrequired
example
curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/[invoiceId]/download-pdf' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'
Response
OK
Body
object | application/json
codeinteger
dataobject
Get invoice extra field configs
GET https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/extra-fieldsRequest
Get invoice extra field configs
Authentication
- authToken in header
Parameters
- offset in query - integerPagination offset default: 0
- limit in query with default of 10 - integerPagination limit default: 10
example
curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v3/io/ip/invoices/extra-fields \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'
Response
OK
Body
object | application/json
Response for successful request
codeinteger
Response code of success request.Example: 200dataarray[object]
example
{
"code": 200,
"meta": {
"pagination": {
"limit": 10,
"offset": 0,
"totalCount": 1
}
},
"data": [
{
"id": 0,
"uuid": "string",
"fieldName": "string",
"fieldType": 0,
"isRequired": true,
"isUnique": true,
"visibleToEnduser": true,
"configType": 1,
"defaultValue": "string",
"maximumLength": "string",
"numberOfRows": "string",
"maximumValue": "string",
"listOfValue": [
"string"
]
}
]
}
Did you find what you were looking for?