79172431

Date: 2024-11-09 09:17:01
Score: 1
Natty:
Report link

You can make discount code using Shopify API like

  1. Set Up a 10% Discount for Orders Over $50
  2. Product-Specific Discounts
  3. Customer-Based Discounts

Step 1: Set Up a New Price Rule


    POST /admin/api/2023-04/price_rules.json
    {
      "price_rule": {
        "title": "15% Off on Orders Over $100",
        "target_type": "line_item",
        "target_selection": "all",
        "allocation_method": "across",
        "value_type": "percentage",
        "value": "-15.0",
        "customer_selection": "all",
        "starts_at": "2024-11-01T00:00:00Z",
        "prerequisite_subtotal_range": {
          "greater_than_or_equal_to": "100.00"
        }
      }
    }

Step 2:

Generate a Discount Code


    POST /admin/api/2023-04/price_rules/{price_rule_id}/discount_codes.json
    {
      "discount_code": {
        "code": "SAVE15"
      }
    }

you can make discount on other conditions as well as described here

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: ahmad ali