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:
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:
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:
Now retrieve again to see the new update
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