Create Price Rule

Example Request: 20% off for all products, no conditions

{
    "price_rule": {
        "title": "20% off for all products, no conditions",
        "value": 20,
        "value_type": "percentage",
        "usage_limit": "-1",
        "allocation_limit": "0",
        "once_per_customer": "0",
        "prerequisite": "0",
        "customer_selection": "all",
        "target_selection": "all",
        "target_type": "",
        "starts_at": "1577844000",
        "ends_at": "-1",
        "entitled_product_ids": [],
        "entitled_variant_ids": []
    }
}

Example Request: Buy 2 to get 30% off

{
    "price_rule": {
        "title": "Buy 2 to get 30% off",
        "value": "",
        "value_type": "percentage",
        "usage_limit": "-1",
        "allocation_limit": "0",
        "once_per_customer": "0",
        "prerequisite": "1",
        "customer_selection": "all",
        "target_selection": "all",
        "target_type": "",
        "starts_at": "1577844000",
        "ends_at": "-1",
        "entitled_product_ids": [],
        "entitled_variant_ids": [],
        "prerequisite_quantity_range": [
            {
                "greater_than_or_equal_to": "2",
                "target_data": [],
                "target_type": "",
                "value": 30
            }
        ]
    }
}

Example Request: 20% off for all variants of specific products

{
    "price_rule": {
        "title": "20% off for all variants of specific products",
        "value": 20,
        "value_type": "percentage",
        "usage_limit": "-1",
        "allocation_limit": "0",
        "once_per_customer": "0",
        "prerequisite": "0",
        "customer_selection": "all",
        "target_selection": "entitled",
        "target_type": "",
        "starts_at": "1577844000",
        "ends_at": "-1",
        "entitled_product_ids": [
            "0d70c3d5-aa8c-43eb-a83f-5bd91cc9552b",
            "023c8abb-23b5-4623-8469-fa4dcff61073"
        ],
        "entitled_variant_ids": []
    }
}

Example Request: $20 off for all products, no conditions, used up to 100 times

{
    "price_rule": {
        "title": "$20 off for all products, no conditions, used up to 100 times",
        "value": 20,
        "value_type": "fixed_amount",
        "usage_limit": "100",
        "allocation_limit": "0",
        "once_per_customer": "0",
        "prerequisite": "0",
        "customer_selection": "all",
        "target_selection": "all",
        "target_type": "",
        "starts_at": "1577844000",
        "ends_at": "-1",
        "entitled_product_ids": [],
        "entitled_variant_ids": []
    }
}

Example Request: Buy $180 get $20 off,once for one customer

{
    "price_rule": {
        "title": "Buy $180 get $20 off,once for one customer",
        "value": 20,
        "value_type": "fixed_amount",
        "usage_limit": "-1",
        "allocation_limit": "0",
        "once_per_customer": "1",
        "prerequisite": "1",
        "customer_selection": "all",
        "target_selection": "all",
        "target_type": "",
        "starts_at": "1577844000",
        "ends_at": "-1",
        "entitled_product_ids": [],
        "entitled_variant_ids": [],
        "prerequisite_subtotal_range": [
            {
                "greater_than_or_equal_to": "180",
                "value": "20",
                "target_type": "",
                "target_data": []
            }
        ]
    }
}
Language
Credentials
Header
Click Try It! to start a request and see the response here!