Server to Server Management APIs
Shopping List

Shopping List

BigCommerce B2B Edition Shopping List

Get Shopping Lists

GET /shopping-list

Request

Get a list of shopping lists viewable based on user permissions of a buyer user ID.

A junior buyer can see all of the lists they create and no one else's.

A senior buyer or admin can see all of the companies approved or ready for approval lists. This would include lists sent by junior buyers.

Authentication

  • authToken in header

Parameters

  • userId in query - integer
    required
    B2B Edition buyer user ID (Either userId or customerId must be passed, but not both.)
  • limit in query with default of 10 - integer
    Pagination limit default: 10
  • offset in query - integer
    Pagination offset default: 0
  • channelId in query - number
    BigCommerce channel ID
  • customerId in query - integer
    required
    BigCommerce customer ID (Either userId or customerId must be passed, but not both.)
  • createdUserId in query - integer
    B2B Edition buyer user ID, if the userId has permissions to view all shopping lists of the company, entering this parameter will filter out the shopping lists created by that user.

example

curl --request GET \
--url https://api-b2b.bigcommerce.com/api/v3/io/shopping-list \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
Response for successful request
  • code
    integer

    Response code of success request.
    Example: 200
  • meta
    object

    Used to response pagination information
    Example: {"pagination":{"limit":10,"offset":0,"totalCount":1}}
  • data
    array[object]

example-1

{
"code": 200,
"meta": {
"message": "SUCCESS",
"pagination": {
"limit": 10,
"offset": 0,
"totalCount": 1
}
},
"data": [
{
"id": 1,
"name": "my first shopping list",
"description": "this is my first shopping list",
"status": 0,
"companyId": 1,
"userId": 12,
"createdAt": 1631495936,
"updatedAt": 1631495936,
"channelId": 0,
"channelName": "string"
}
]
}

Create a Shopping List

POST /shopping-list

Request

Create a shopping list for a user

Authentication

  • authToken in header

Body

object | application/json
  • name
    string
    required

  • description
    string

    Description information for shopping list
  • status
    integer

    status of shopping list, (0: approved, 20: deleted, 30: draft, 40: ready for approval)

    Allowed: 0 | 30 | 40

  • userId
    integer

    B2B Edition buyer user ID (one of userId and customerId must be passed, and only one of them can be passed).
  • customerId
    integer

    BigCommerce customer ID(one of userId and customerId must be passed, and only one of them can be passed).
  • channelId
    integer

    BigCommerce channel ID
  • items
    array[object]

example-1

{
"name": "my first shopping list",
"description": "this is my first shopping list",
"status": 0,
"userId": 0,
"channelId": 1,
"items": [
{
"productId": 123,
"variantId": 321,
"quantity": 5
}
]
}

Response

OK

Body

object | application/json
Response for successful request
  • code
    integer

    Response code of success request.
    Example: 200
  • meta
    object

  • data
    object

example-1

{
"code": 200,
"meta": {
"message": "SUCCESS"
},
"data": {
"shoppingListId": 1
}
}

Get a Shopping List

GET /shopping-list/{shoppingListId}

Request

Get a shopping list detail information

Authentication

  • authToken in header

Parameters

  • shoppingListId in path - integer
    required
    The unique ID for a shopping list.
  • userId in query - integer
    B2B Edition buyer user ID, you can enter a user ID to check if this user can view this shopping list.
  • sortBy in query - string
    the field to sort by
    Example: sortOrder

    Allowed: quantity | productName | productSku | sortOrder

  • orderBy in query - string
    desc or asc for sort by
    Example: DESC

    Allowed: DESC | ASC

  • customerId in query - integer
    BigCommerce customer ID, passing this parameter will obtain the shopping list according to the b2c user.
  • offset in query0 - integer
    Pagination offset for shopping list items
  • limit in query with default of 250 - integer
    Pagination limit for shopping list items

example

curl --request GET \
--url 'https://api-b2b.bigcommerce.com/api/v3/io/shopping-list/[shoppingListId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
Response for successful request
  • code
    integer

    Response code of success request.
    Example: 200
  • meta
    object

  • data
    object

example-1

{
"code": 200,
"meta": {
"message": "SUCCESS",
"pagination": {
"limit": 0,
"offset": 0,
"totalCount": 0
}
},
"data": {
"id": 1,
"name": "my first shopping list",
"description": "this is my first shopping list",
"status": 0,
"companyId": 1,
"userId": 12,
"createdAt": 1631495936,
"updatedAt": 1631495936,
"channelId": 0,
"channelName": "string",
"items": [
{
"id": 1,
"productId": 123,
"variantId": 321,
"quantity": 5,
"sortOrder": 0,
"optionList": {
"optionId": "string",

Update a Shopping List

PUT /shopping-list/{shoppingListId}

Request

update a shopping list detail. you can also update shopping list items by update the items field by this API endpoints. note:

  1. User id for update the shopping list is not required. You can optionally enter this field according to whether you need to judge user permissions.
  2. The ID field in shopping list items is an optional field. If it is null, you can only change the quantity of this item by product ID, variant ID and option list, these three fields will determine an actual item. If it is not null, the ID field will determine an actual item and you can change product ID, variant ID, and option list by this way.
  3. Set a zero quantity of shopping list item will delete this item.
  4. Quantity = 0 will remove item, you can modify multiple items at one time.

Authentication

  • authToken in header

Parameters

  • shoppingListId in path - integer
    required
    The unique ID for a shopping list.

Body

object | application/json
  • name
    string

    name for shopping list
    Example: my first shopping list
  • description
    string

    description information for shopping list
    Example: this is my first shopping list
  • status
    integer

    status of shopping list, (0: approved, 20: deleted, 30: draft, 40: ready for approval)

    Allowed: 0 | 30 | 40

  • userId
    integer

    B2B Edition buyer user ID, you can enter a user ID to check if this user can update this shopping list.
    Example: 12
  • customerId
    integer

    BigCommerce customer ID, passing this parameter will obtain the shopping list according to the b2c user.
  • items
    array[object]

example-1

{
"name": "test",
"description": "develop test",
"status": 0,
"companyId": 155576,
"userId": 223437,
"items": [
{
"id": 75693,
"productId": 107,
"variantId": 73,
"quantity": 0
},
{
"id": 85416,
"productId": 86,
"variantId": 66,
"quantity": 40
},
{
"id": 76533,
"productId": 112,
"variantId": 79,
"quantity": 1
}
]
}

Response

OK

Body

object | application/json
Response for successful request
  • code
    integer

    Response code of success request.
    Example: 200
  • meta
    object

  • data
    object

example-1

{
"code": 200,
"meta": {
"message": "SUCCESS"
},
"data": {
"id": 1,
"name": "my first shopping list",
"description": "this is my first shopping list",
"status": 0,
"companyId": 1,
"userId": 12,
"createdAt": 1631495936,
"updatedAt": 1631495936
}
}

Delete a Shopping List

DELETE /shopping-list/{shoppingListId}

Request

Delete a shopping list. Note this will not delete a shopping list item.

Authentication

  • authToken in header

Parameters

  • shoppingListId in path - integer
    required
    The unique ID for a shopping list.
  • userId in query - integer
    B2B Edition buyer user ID, you can enter a user ID for check if this user can delete this shopping list.

example

curl --request DELETE \
--url 'https://api-b2b.bigcommerce.com/api/v3/io/shopping-list/[shoppingListId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
Response for successful request
  • code
    integer

    Response code of success request.
    Example: 200
  • meta
    object

  • data
    object

example-1

{
"code": 200,
"meta": {
"message": "SUCCESS"
},
"data": {
"shoppingListId": 1
}
}

Delete a Shopping List Item

DELETE /shopping-list/{shoppingListId}/items/{itemId}

Request

Delete a shopping list item

Authentication

  • authToken in header

Parameters

  • shoppingListId in path - string
    required
  • itemId in path - string
    required

example

curl --request DELETE \
--url 'https://api-b2b.bigcommerce.com/api/v3/io/shopping-list/[shoppingListId]/items/[itemId]' \
--header 'Content-Type: application/json' \
--header 'authToken: {{token}}'

Response

OK

Body

object | application/json
  • code
    number
    required

  • message
    string
    required

  • data
    object
    required

example-1

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

See something you can improve? Edit this file on GitHub

Did you find what you were looking for?