Skip to Content

Orders

Get All Orders

GET /orders

Request

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 - string
    required
    The unique store hash associated with a BigCommerce store that has B2B Edition enabled.
    Example: abc123
  • companyId in query - integer
    Unique numeric ID of the Company account.
  • limit in query with default of 10 - integer
    Determines the number of records to return per page. If left blank, this defaults to 10.
    Example: 15
  • offset in query0 - integer
    The 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 - string
    Establish 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 - string
    Sorts 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 - integer
    The 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 - integer
    Enter a Unix timestamp to retrieve all orders updated after that time.
  • maxModified in query - integer
    Enter a Unix timestamp to retrieve all orders updated before that time.
  • minCreated in query - integer
    Enter a Unix timestamp to retrieve all orders created after that time.
  • maxCreated in query - integer
    Enter a Unix timestamp to retrieve all orders created before that time.
  • showExtra in query - boolean
    Indicates whether or not extra fields should be included in the response.
  • channelIds[] in query with default of 1 - array
    BigCommerce channel IDs
    Type: array[number]

example

Response

OK

Body

object | application/json
  • code
    integer

  • meta
    object

  • data
    array[]

without-extra-fields

with-extra-fields

Create an Order

POST /orders

Request

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 - string
    required
    The unique store hash associated with a BigCommerce store that has B2B Edition enabled.
    Example: abc123

Body

application/json
  • bcOrderId
    integer
    required

    The BigCommerce order ID.
    Example: 123
  • customerId
    integer
    required

    The ID of a BigCommerce customer account with a corresponding Company user account.
    Example: 321
  • poNumber
    string

    The order's Purchase Order (PO), if used.
    Example: 04152025-0002
  • extraFields
    array[]

    Contains extra field information associated with the order.

example

Response

OK

Body

object | application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    object

  • meta
    object

example

Get an Order

GET /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 - integer
    required
    The BigCommerce order ID.

example

Response

OK

Body

application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    array[]

example

Update an Order

PUT /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 with fieldName and fieldValue)
    • This array must be included if your store has required order extra fields.

Authentication

  • X-Auth-Token in header

Parameters

  • bcOrderId in path - integer
    required
    The BigCommerce order ID.

Body

application/json
  • poNumber
    string

    The order's Purchase Order (PO), if used.
    Example: 04152025-0002
  • extraFields
    array[]

    Contains extra field information associated with the order.

example

Response

OK

Body

application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    array[]

  • message
    string

    Default: SUCCESS

example

Reassign Orders to a Different Company

PUT /customers/{customerId}/orders/company

Request

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 - integer
    required
    The ID of a BigCommerce customer account with a corresponding Company user account.

Body

object | application/json
  • bcGroupId
    integer
    required

    The unique identifier for the BigCommerce customer group that corresponds to the Company account that you are assigning to the order.
    Example: 123

example

Response

OK

Body

application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    object

  • message
    string

    Default: SUCCESS

example

Get Order Products

GET /orders/{bcOrderId}/products

Request

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 - integer
    required
    The BigCommerce order ID.

example

Response

OK

Body

application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    array[]

  • message
    string

    Default: SUCCESS

example

Assign Customer Orders to Company

PUT /customers/{customerId}/orders/b2b

Request

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 - string
    required
    The unique store hash associated with a BigCommerce store that has B2B Edition enabled.
    Example: abc123
  • customerId in path - integer
    required
    The ID of a BigCommerce customer account with a corresponding Company user account.

Response

OK

Body

application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    object

  • message
    string

    Default: SUCCESS

example

Get Order Extra Field Configs

GET /orders/extra-fields

Request

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 - string
    required
    The unique store hash associated with a BigCommerce store that has B2B Edition enabled.
    Example: abc123
  • limit in query with default of 10 - integer
    Determines the number of records to return per page. If left blank, this defaults to 10.
    Example: 15
  • offset in query0 - integer
    The number of results to skip before returning the first result. If left blank, this defaults to 0.
    Example: 5

example

Response

OK

Body

object | application/json
  • code
    integer

    HTTP Response Code

    Default: 200

  • data
    array[object]

  • meta
    object

example

Did you find what you were looking for?