beehexa products channel assignments

Bigcommerce API 2024: How To Retrieve And Create Products Channel Assignments

Retrieving And Creating Products Channel Assignments is really important and necessary so today I will guide you in detail on the steps to work with Products Channel Assignments

Retrieve Products Channel Assignments

curl --request get \

ย ย --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/channel-assignments' \

ย ย --header 'Content-Type: application/json' \

ย ย --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx' \

ย ย --data '{}'
Code language: PHP (php)

Log in to Postman, choose a workspace, and open a new request tab. Here, select GET and paste the URL:  

https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/channel-assignments

Replace Store hash with your store hash

Now in the header section, fill in the information about:

  • X-auth-token
  • Accept
  • Content-type

After all, click send button to see the result:

{
  "data": [
    {
      "product_id": 0,
      "channel_id": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 246,
      "count": 5,
      "per_page": 5,
      "current_page": 1,
      "total_pages": 50,
      "links": {
        "next": "?limit=5&page=2",
        "current": "?limit=5&page=1"
      }
    }
  }
}
Code language: JSON / JSON with Comments (json)

Create Products Channel Assignments

To create Create Products channel Assignments select PUT and paste the URL:  

https://api.bigcommerce.com/stores/x5d3kv9efh/v3/catalog/products/channel-assignments

Replace Store hash with your store hash

In the header section, You have to fill in the information about:

  • X-auth-token
  • Accept
  • Content-type

In the Body section, You need to declare the information about:

Product_id: integer

Channel_id: integer

Example

[

  {

    “product_id”: 111,

    “channel_id”: 5

  }

]

After all, click send button to see the result:

beehexa products channel assignments 2
beehexa products channel assignments 2

Now retrieve again to see the new update

beehexa products channel assignments 3
beehexa products channel assignments 3

The above are steps to Get and Create Products Channel Assignments in BigCommerce Using Postman. You need to follow the steps that I instructed above. If you have any difficulty or questions at any step, please comment below or refer to our BigCommerce API documentation if you have any questions.

Hope you are successful