Storefront APIs
Orders

Order

Company based order management.

Get Orders

GET /orders

Request

Get orders. Equivalent Storefront GraphQL API Query: allOrders. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • beginDateAt in query - string
    Begin query date
  • endDateAt in query - string
    End query date
  • orderBy in query with default of createdAt - string
    Order by
  • sortBy in query with default of DESC - string
    Sort order by desc or asc
  • offset in query with default of 0 - string
    Pagination offset
  • limit in query with default of 10 - string
    Pagination limit
  • isShowMy in query with default of 0 - string
    Is show my orders
  • includeExtra in query with default of 0 - string
    Include extra field
  • q in query - string
    Query string
  • companyName in query - string
    Company name
  • orderNumber in query - string
    Order number
  • poNumber in query - string
    PO number
  • status[] in query - string
    Order status

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/orders \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"list": [
{
"orderId": 635,
"companyName": "company name",
"createdAt": "1622616050",
"updatedAt": "1622616050",
"isInvoiceOrder": 0,
"orderStatus": "Awaiting Payment",
"customOrderStatus": "Awaiting Pay Kido Test",
"statusCode": 0,
"totalIncTax": 450.45,
"currencyCode": "CNY",
"money": {
"currency_location": "left",
"currency_token": "¥",
"decimal_token": ".",
"decimal_places": 2,
"thousands_token": ","
},
"firstName": "Jo",

Create an Order

POST /orders

Request

Create an order in the BigCommerce store. Equivalent Storefront GraphQL API Mutation: createOrder. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Body

object | application/json
  • orderId
    string
    required

    Unique order ID in BigCommerce store
  • poNumber
    string

    PO number
  • isSaveOrderComment
    string

    If save order comment
  • extraFields
    array[object]

example

{
"orderId": "string",
"poNumber": "string",
"isSaveOrderComment": "string",
"extraFields": [
{
"fieldName": "string",
"fieldValue": "string"
}
]
}

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"orderId": "1234"
}
}

Get Order Images

GET /orders/images

Request

Get order images. Equivalent Storefront GraphQL API Query: orderImages. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • orderIds[] in query - string
    Unique order ID

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/orders/images \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    array[object]
    required

example-1

{
"code": 200,
"message": "Success",
"data": [
{
"orderId": "123",
"imageUrl": "url"
}
]
}

Get Order Products

GET /orders/{orderId}/products

Request

Get order products by orderId. Equivalent Storefront GraphQL API Query: orderProducts. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • orderId in path - string
    required
    Unique order ID in BigCommerce store

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/orders/[orderId]/products' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    array[object]
    required

example-1

{
"code": 200,
"message": "Success",
"data": [
{
"productId": "104",
"quantity": "2",
"variantId": "142",
"optionList": [
{
"option_id": 147,
"option_value": "95"
}
]
}
]
}

Get Order Detail

GET /orders/{orderId}/details

Request

Get order detail by orderId. Please refer to BigCommerce API for detailed parameter introduction. Equivalent Storefront GraphQL API Query: order. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • orderId in path - string
    required
    Unique order ID in BigCommerce store

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v2/orders/[orderId]/details' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"id": 636,
"customer_id": 8186,
"date_created": "Wed, 02 Jun 2021 07:01:56 +0000",
"date_modified": "Wed, 02 Jun 2021 07:01:57 +0000",
"date_shipped": "",
"status_id": 7,
"status": "Awaiting Payment",
"subtotal_ex_tax": "91.9000",
"subtotal_inc_tax": "91.9000",
"subtotal_tax": "0.0000",
"base_shipping_cost": "0.0000",
"shipping_cost_ex_tax": "0.0000",
"shipping_cost_inc_tax": "0.0000",
"shipping_cost_tax": "0.0000",
"shipping_cost_tax_class_id": 2,
"base_handling_cost": "0.0000",
"handling_cost_ex_tax": "0.0000",
"handling_cost_inc_tax": "0.0000",
"handling_cost_tax": "0.0000",
"handling_cost_tax_class_id": 2,

Get Ordered Product List

GET /ordered-products

Request

Get ordered products. Equivalent Storefront GraphQL API Query: orderedProducts. For more information, see the GraphQL Playground.

Authentication

  • Authorization in header in the format of Bearer {{token}}

Parameters

  • offset in query - string
    Pagination offset
  • limit in query - string
    Pagination limit
  • beginDateAt in query - string
    Begin date
  • endDateAt in query - string
    End date
  • minOrderedTimes in query - string
    Minimum ordered times
  • maxOrderedTimes in query - string
    Maximum ordered times
  • productID in query - string
    Product ID
  • q in query - string
    Query string

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v2/ordered-products \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

    >= 1 characters
  • data
    object
    required

example-1

{
"code": 200,
"message": "SUCCESS",
"data": {
"pagination": {
"totalCount": 3,
"offset": 0,
"limit": 10
},
"list": [
{
"orderProductId": "264",
"productName": "[Sample] Utility Caddy",
"sku": "e1-1",
"productId": "104",
"variantId": "142",
"lastOrdered": "1622617316",
"optionList": [
{
"id": 1595,
"option_id": 32,
"order_product_id": 1461,
"product_option_id": 147,
"display_name": "Size",
"display_name_customer": "Size",
"display_name_merchant": "Size",
"display_value": "Small",

See something you can improve? Edit this file on GitHub

Did you find what you were looking for?