Endpoints:
- Get all accessories for a product
- Add an accessory to a product
- Update an accessory on a product
- Delete an accessory on a product
Get all accessories for a product
POST /products/1/accessories
will return a paginated list of all accessories that are assigned to the product with the id
of 1
Optional URL parameters:
page
from the next_page
property that was passed from a previous result
page_size
the number of results per page
Example JSON Response
{
"total_records":10,
"page":null,
"next_page":2116349,
"data":[
{
"id":1781491,
"parent_id":400935249,
"type":"product",
"accessory_id":4812973015074,
"sort_order":0
},
{
"id":367058,
"parent_id":33240154146,
"type":"product",
"accessory_id":541702684706,
"sort_order":0
},
{...},
{...}
]
}
Add an accessory to a product
POST /products/1/accessories/
will add a new accessory to the product with the id
of 1
Required Parameters:
accessory_id
the Shopify Product ID (not variant ID) of the product you want to add as the accessory.
Optional Parameters:
sort_order
the display order of the accessory compared to the other accessories that are assigned to the same product.
Example JSON Request
{
"accessory_id": 2,
"sort_order": 1
}
This will return200 OK
with the current JSON representation of the accessory if the update was a success.
Example JSON Response
{
"id":1781491,
"parent_id":400935249,
"type":"product",
"accessory_id":4812973015074,
"sort_order":0
}
Update an accessory on a product
PUT /products/1/accessories/2
will update the accessory with the id
of 2
that is assigned to the product with the id
of 1
Optional Parameters:
sort_order
the display order of the accessory compared to the other accessories that are assigned to the same product.
Currently only the sort_order
can be updated through this endpoint.
Example JSON Request
{
"sort_order": 1
}
This will return200 OK
with the current JSON representation of the accessory if the update was a success.
Example JSON Response
{
"id":1781491,
"parent_id":400935249,
"type":"product",
"accessory_id":4812973015074,
"sort_order":0
}
Delete an accessory from a product
DELETE /products/1/accessories/2
will delete the accessory with the id
of 2
that is assigned to the product with the id
of 1
This will return200 OK
with the current JSON representation of the accessory if the update was a success.
Example JSON Response
{
"id":1781491,
"parent_id":400935249,
"type":"product",
"accessory_id":4812973015074,
"sort_order":0
}