put https://example.com/api/v1/scrooge/discounts/bulk
Create multiple bulk discounts, including tiered and BxGy discounts.
- store: The identifier for the store where discounts are applied.
- discount_info: A list of discount objects, which can be of various types including:
- TieredDiscountModel
- BxGyDiscountModel
- TimedDiscountModel
- CustomBxGyDiscountModel
Example Request Body:
{
"store": "store_name",
"discount_info": [
{
"type": "TIERED",
"value": [
{
"min_cart_value": 50.0,
"min_quantity": 2,
"type": "PERCENTAGE",
"value": 10.0,
"buy": [{"id": "product_id", "variants": ["variant_id"]}],
"label": "10% off on orders over $50",
"uid": "unique_discount_id_1"
},
{
"min_cart_value": 100.0,
"min_quantity": 2,
"type": "PERCENTAGE",
"value": 20.0,
"buy": [{"id": "product_id", "variants": ["variant_id"]}],
"label": "20% off on orders over $100",
"uid": "unique_discount_id_2"
}
],
"applies_to": {
"collections": ["collection_id_1"]
}
}
],
"discount_ids_map": {
"unique_discount_id_1": "discount_id_1"
},
"collection_ids": ["collection_id_2"]
}
Example Response:
{
"status": "success",
"data": {
"discount_ids_map": {
"unique_discount_id_1": "discount_id_1",
"unique_discount_id_2": "discount_id_2"
},
"collection_ids": ["collection_id_2"]
}
}
Responses:
- 200: Successful creation of bulk discounts.
- 400: Invalid store or payload.
- 500: Internal server error.