Orders
Get All Orders
GET https://api-b2b.bigcommerce.com/api/v3/io/ordersRequest
Retrieves limited information for all orders, including B2B-specific information like Company IDs and order extra fields. The response includes orders placed by B2C customers and guest shoppers. Use Get Order Products to retrieve an order's product details, or use the BigCommerce Orders V2 API to retrieve all order details except those specific to B2B Edition, like Company ID and extra fields.
Use the parameters to filter the returned orders by attributes like associated Company ID, date created, or storefront channel. You can also set the showExtra
parameter to true
in order to return extra field values associated with the order.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- companyId in query - integerUnique numeric ID of the Company account.
- limit in query with default of 10 - integerDetermines the number of records to return per page. If left blank, this defaults to
10
.Example: 15 - offset in query0 - integerThe number of results to skip before returning the first result. If left blank, this defaults to
0
.Example: 5 - orderBy in query with default of DESC - stringEstablish a descending or ascending order of results. The order defaults to descending if the parameter is not included.Example: ASC
Allowed: DESC | ASC
- sortBy in query with default of updatedAt - stringSorts results by creation date or the last updated date. It defaults to the last updated date if no parameter is provided.Example: updatedAt
Allowed: createdAt | updatedAt
- bcOrderId in query - integerThe BigCommerce order ID. This parameter does not accept the B2B Edition order ID returned in certain Server to Server Orders endpoints.Example: 123
- minModified in query - integerEnter a Unix timestamp to retrieve all orders updated after that time.
- maxModified in query - integerEnter a Unix timestamp to retrieve all orders updated before that time.
- minCreated in query - integerEnter a Unix timestamp to retrieve all orders created after that time.
- maxCreated in query - integerEnter a Unix timestamp to retrieve all orders created before that time.
- showExtra in query - booleanIndicates whether or not extra fields should be included in the response.
- channelIds[] in query with default of 1 - arrayBigCommerce channel IDsType: array[number]
example
Response
Body
codeinteger
dataarray[]
without-extra-fields
with-extra-fields
Create an Order
POST https://api-b2b.bigcommerce.com/api/v3/io/ordersRequest
Generates an order record in B2B Edition after a Company user places an order. This occurs automatically; however, you can populate extra information on a B2B order by using a webhook that first listens for BigCommerce order creation and then calls the Create an Order endpoint. The request must be made within 10 seconds of an order's creation for it to be successful.
This endpoint does not create a new order in your store. Use the Orders V2 API to add new orders via the API.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
Body
bcOrderIdinteger
requiredThe BigCommerce order ID.Example: 123customerIdinteger
requiredThe ID of a BigCommerce customer account with a corresponding Company user account.Example: 321poNumberstring
The order's Purchase Order (PO), if used.Example: 04152025-0002extraFieldsarray[]
Contains extra field information associated with the order.
example
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataobject
example
Get an Order
GET https://api-b2b.bigcommerce.com/api/v3/io/orders/{bcOrderId}Request
Retrieves limited information for a specific order based on the bcOrderId
provided. The response includes the same fields as the Get All Orders endpoint, including B2B extra fields and PO numbers.
The bcOrderId
parameter must include a valid BigCommerce Order ID (not the B2B Edition order ID returned in certain Orders endpoints) for the request to be successful.
Authentication
- X-Auth-Token in header
Parameters
- bcOrderId in path - integerrequiredThe BigCommerce order ID.
example
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataarray[]
example
Update an Order
PUT https://api-b2b.bigcommerce.com/api/v3/io/orders/{bcOrderId}Request
Updates B2B information on a specific order based on the bcOrderId
provided.
The bcOrderId
parameter must include a valid BigCommerce Order ID (not the B2B Edition order ID returned in certain Orders endpoints) for the request to be successful. You must also include at least one of the following fields in the request body:
poNumber
extraFields
(array withfieldName
andfieldValue
)- This array must be included if your store has required order extra fields.
Authentication
- X-Auth-Token in header
Parameters
- bcOrderId in path - integerrequiredThe BigCommerce order ID.
Body
poNumberstring
The order's Purchase Order (PO), if used.Example: 04152025-0002extraFieldsarray[]
Contains extra field information associated with the order.
example
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataarray[]
example
Reassign Orders to a Different Company
PUT https://api-b2b.bigcommerce.com/api/v3/io/customers/{customerId}/orders/companyRequest
Reassigns all orders from a specific B2B Edition Company user to a different Company account. This adds the orders to the Company's Buyer Portal. This does not automatically reassign the Company user account to the Company, however.
Independent vs. Dependent Companies Behavior
This request uses the bcGroupId
field to assign orders by customer group ID instead of the Company ID. As a result, it is only supported if your store uses the legacy Dependent Companies behavior. Do not use this request if your store uses Independent Companies behavior.
For a successful response, you must include the bcGroupId
field with a BigCommerce customer group ID value that corresponds to a Company account.
Authentication
- X-Auth-Token in header
Parameters
- customerId in path - integerrequiredThe ID of a BigCommerce customer account with a corresponding Company user account.
Body
bcGroupIdinteger
requiredThe unique identifier for the BigCommerce customer group that corresponds to the Company account that you are assigning to the order.Example: 123
example
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataobject
example
Get Order Products
GET https://api-b2b.bigcommerce.com/api/v3/io/orders/{bcOrderId}/productsRequest
Retrieves product details of a specific order based on the bcOrderId
provided. The bcOrderId
parameter must include a valid BigCommerce Order ID (not the B2B Edition order ID returned in certain Orders endpoints) for the request to be successful.
This does not include all product information, such as pricing and physical dimensions. You can retrieve this information by using the List Order Products endpoint of the BigCommerce Orders API.
Authentication
- X-Auth-Token in header
Parameters
- bcOrderId in path - integerrequiredThe BigCommerce order ID.
example
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataarray[]
example
Assign Customer Orders to Company
PUT https://api-b2b.bigcommerce.com/api/v3/io/customers/{customerId}/orders/b2bRequest
Associates orders from a buyer to their Company account based on the customerId
entered. This endpoint is useful if a buyer has orders they placed before applying for or being added to a Company account.
The customerId
parameter must include a valid BigCommerce customer ID for the request to be successful. This is different from the B2B Edition Company user ID returned by some B2B API endpoints, such as the id
field in Get Users.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- customerId in path - integerrequiredThe ID of a BigCommerce customer account with a corresponding Company user account.
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataobject
example
Get Order Extra Field Configs
GET https://api-b2b.bigcommerce.com/api/v3/io/orders/extra-fieldsRequest
Returns a list of available extra fields configurations for B2B orders.
We recommend caching the response results to avoid frequent API requests.
Authentication
- X-Auth-Token in header
Parameters
- X-Store-Hash in header - stringrequiredThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.Example: abc123
- limit in query with default of 10 - integerDetermines the number of records to return per page. If left blank, this defaults to
10
.Example: 15 - offset in query0 - integerThe number of results to skip before returning the first result. If left blank, this defaults to
0
.Example: 5
example
Response
Body
codeinteger
HTTP Response CodeDefault: 200
dataarray[object]