MasterProductOffers are the offers of a specific common product. This entity is added by the Common Products for Vendors add-on that is available in Multi-Vendor.
To get a list of all offers of a specific common product, send a GET request to /api/master_products/:id/master_product_offers. For example:
GET /api/master_products/310/master_product_offers
To get a specific product offer, send the same request with the ID of the offer. For example:
GET /api/master_products/310/master_product_offers/313
Pagination, sorting, and filtering parameters are inherited from Products.
The Common Products for Vendors add-on adds the show_master_products_only filtering parameter with true or false value, available via Products API.
The true value will return only common products in the response, while the false will return only products offered by vendors.
| Field name | Values | Description |
|---|---|---|
| master_product_id | integer | ID of a common product to which the product belongs |
| master_product_status | ADH |
The status of a common product to which the product belongs:
A for ActiveD for DisabledH for Hidden |
| master_product_offers_count | integer | The current number of product offers that the common product has |
To add a new offer of a common product, you need to specify the ID of the common product and the id of the vendor that will sell the product. Send a POST request to /api/master_products/:id/master_product_offers with the company_id field in JSON.
POST /api/master_products/310/master_product_offers
{
"company_id": "1"
}
This request creates a product offer of a common product with the id 310 for the vendor with the ID 1.
product_id:{
"product_id": 310
}
Once a product offer is created, you can update its price, quantity, and other details. To update an existing product offer, send the PUT request to /api/master_products/:id/master_product_offers/:id. For example:
PUT /api/master_product/310/master_product_offers/313
{
"price": "100",
"amount": "5"
}
This request updates the price and quantity of the product offer.
product_id.To delete a product, send a DELETE request to /api/master_products/:id/master_product_offers/:id. For example:
DELETE /api/master_products/310/master_product_offers/313
This request will delete the product offer with the ID 313.
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.