{
  "info": {
    "name": "Coupon System API",
    "description": "Complete collection of coupon creation requests for all types",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Admin - Create Coupons",
      "item": [
        {
          "name": "1. Create General Coupon (Percentage)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"general\",\n  \"client_type\": \"normal\",\n  \"code\": \"SAVE20\",\n  \"type\": \"percentage\",\n  \"value\": 20,\n  \"min_order_total\": 100,\n  \"max_order_total\": 5000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 100,\n  \"limit_for_user\": 5,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"General 20% Discount\",\n    \"description\": \"Get 20% off on all products\"\n  },\n  \"ar\": {\n    \"name\": \"خصم عام 20٪\",\n    \"description\": \"احصل على خصم 20٪ على جميع المنتجات\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "2. Create General Coupon (Fixed)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"general\",\n  \"client_type\": \"normal\",\n  \"code\": \"FLAT50\",\n  \"type\": \"fixed\",\n  \"value\": 50,\n  \"min_order_total\": 200,\n  \"max_order_total\": 5000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 150,\n  \"limit_for_user\": 3,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"Flat 50 SAR Off\",\n    \"description\": \"Get 50 SAR off on orders above 200 SAR\"\n  },\n  \"ar\": {\n    \"name\": \"خصم ثابت 50 ريال\",\n    \"description\": \"احصل على خصم 50 ريال على الطلبات التي تزيد عن 200 ريال\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "3. Create Vendor Coupon (Percentage)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"vendor\",\n  \"applicable_id\": 5,\n  \"client_type\": \"normal\",\n  \"code\": \"VENDOR15\",\n  \"type\": \"percentage\",\n  \"value\": 15,\n  \"min_order_total\": 150,\n  \"max_order_total\": 3000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 80,\n  \"limit_for_user\": 4,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"15% Off at Vendor Store\",\n    \"description\": \"Get 15% discount on all products from this vendor\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 15٪ في متجر البائع\",\n    \"description\": \"احصل على خصم 15٪ على جميع المنتجات من هذا البائع\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "4. Create Vendor Coupon (Fixed)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"vendor\",\n  \"applicable_id\": 5,\n  \"client_type\": \"normal\",\n  \"code\": \"VENDOR30\",\n  \"type\": \"fixed\",\n  \"value\": 30,\n  \"min_order_total\": 250,\n  \"max_order_total\": 3000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 60,\n  \"limit_for_user\": 2,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"30 SAR Off at Vendor Store\",\n    \"description\": \"Get 30 SAR off on orders from this vendor\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 30 ريال في متجر البائع\",\n    \"description\": \"احصل على خصم 30 ريال على الطلبات من هذا البائع\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "5. Create Category Coupon (Percentage)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"category\",\n  \"applicable_id\": 3,\n  \"client_type\": \"normal\",\n  \"code\": \"CATEGORY25\",\n  \"type\": \"percentage\",\n  \"value\": 25,\n  \"min_order_total\": 100,\n  \"max_order_total\": 2000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 50,\n  \"limit_for_user\": 3,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"25% Off on Electronics\",\n    \"description\": \"Get 25% discount on all electronics products\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 25٪ على الإلكترونيات\",\n    \"description\": \"احصل على خصم 25٪ على جميع منتجات الإلكترونيات\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "6. Create Category Coupon (Fixed)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"category\",\n  \"applicable_id\": 3,\n  \"client_type\": \"normal\",\n  \"code\": \"CATEGORY40\",\n  \"type\": \"fixed\",\n  \"value\": 40,\n  \"min_order_total\": 300,\n  \"max_order_total\": 2000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 40,\n  \"limit_for_user\": 2,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"40 SAR Off on Electronics\",\n    \"description\": \"Get 40 SAR off on electronics products\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 40 ريال على الإلكترونيات\",\n    \"description\": \"احصل على خصم 40 ريال على منتجات الإلكترونيات\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "7. Create Brand Coupon (Percentage)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"brand\",\n  \"applicable_id\": 7,\n  \"client_type\": \"premium\",\n  \"code\": \"BRAND30\",\n  \"type\": \"percentage\",\n  \"value\": 30,\n  \"min_order_total\": 200,\n  \"max_order_total\": 4000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 70,\n  \"limit_for_user\": 5,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"30% Off on Samsung\",\n    \"description\": \"Premium members get 30% off on all Samsung products\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 30٪ على سامسونج\",\n    \"description\": \"يحصل الأعضاء المميزون على خصم 30٪ على جميع منتجات سامسونج\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "8. Create Brand Coupon (Fixed)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"brand\",\n  \"applicable_id\": 7,\n  \"client_type\": \"normal\",\n  \"code\": \"BRAND60\",\n  \"type\": \"fixed\",\n  \"value\": 60,\n  \"min_order_total\": 350,\n  \"max_order_total\": 4000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 50,\n  \"limit_for_user\": 3,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"60 SAR Off on Samsung\",\n    \"description\": \"Get 60 SAR off on Samsung products\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 60 ريال على سامسونج\",\n    \"description\": \"احصل على خصم 60 ريال على منتجات سامسونج\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "9. Create First Order Coupon (Percentage)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"first_order\",\n  \"client_type\": \"normal\",\n  \"code\": \"WELCOME10\",\n  \"type\": \"percentage\",\n  \"value\": 10,\n  \"min_order_total\": 50,\n  \"max_order_total\": 10000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2025-12-31\",\n  \"limit\": 1000,\n  \"limit_for_user\": 1,\n  \"is_active\": true,\n  \"is_first_order\": true,\n  \"en\": {\n    \"name\": \"Welcome 10% Off\",\n    \"description\": \"New customers get 10% off on their first order\"\n  },\n  \"ar\": {\n    \"name\": \"خصم ترحيبي 10٪\",\n    \"description\": \"يحصل العملاء الجدد على خصم 10٪ على طلبهم الأول\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "10. Create First Order Coupon (Fixed)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"first_order\",\n  \"client_type\": \"normal\",\n  \"code\": \"FIRSTORDER25\",\n  \"type\": \"fixed\",\n  \"value\": 25,\n  \"min_order_total\": 150,\n  \"max_order_total\": 10000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2025-12-31\",\n  \"limit\": 500,\n  \"limit_for_user\": 1,\n  \"is_active\": true,\n  \"is_first_order\": true,\n  \"en\": {\n    \"name\": \"First Order 25 SAR Off\",\n    \"description\": \"Get 25 SAR off on your first order above 150 SAR\"\n  },\n  \"ar\": {\n    \"name\": \"خصم 25 ريال للطلب الأول\",\n    \"description\": \"احصل على خصم 25 ريال على طلبك الأول الذي يزيد عن 150 ريال\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"]
            }
          }
        },
        {
          "name": "List All Coupons",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons?perPage=20",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons"],
              "query": [
                {
                  "key": "perPage",
                  "value": "20"
                }
              ]
            }
          }
        },
        {
          "name": "Get Coupon Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons/1",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons", "1"]
            }
          }
        },
        {
          "name": "Update Coupon",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apply_on\": \"general\",\n  \"client_type\": \"normal\",\n  \"code\": \"SAVE25\",\n  \"type\": \"percentage\",\n  \"value\": 25,\n  \"min_order_total\": 100,\n  \"max_order_total\": 5000,\n  \"start_at\": \"2024-01-01\",\n  \"end_at\": \"2024-12-31\",\n  \"limit\": 100,\n  \"limit_for_user\": 5,\n  \"is_active\": true,\n  \"is_first_order\": false,\n  \"en\": {\n    \"name\": \"General 25% Discount\",\n    \"description\": \"Get 25% off on all products\"\n  },\n  \"ar\": {\n    \"name\": \"خصم عام 25٪\",\n    \"description\": \"احصل على خصم 25٪ على جميع المنتجات\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons/1",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons", "1"]
            }
          }
        },
        {
          "name": "Delete Coupon",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{admin_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/dashboard/admin/coupons/1",
              "host": ["{{base_url}}"],
              "path": ["api", "dashboard", "admin", "coupons", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "App - Use Coupons",
      "item": [
        {
          "name": "List Available Coupons",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{user_token}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/app/coupons?per_page=10",
              "host": ["{{base_url}}"],
              "path": ["api", "app", "coupons"],
              "query": [
                {
                  "key": "per_page",
                  "value": "10"
                }
              ]
            }
          }
        },
        {
          "name": "Calculate Cart with Coupon",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{user_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"location_id\": 1,\n  \"coupon_code\": \"SAVE20\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/app/cart/calculate",
              "host": ["{{base_url}}"],
              "path": ["api", "app", "cart", "calculate"]
            }
          }
        },
        {
          "name": "Create Order with Coupon",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{user_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"location_id\": 1,\n  \"payment_method\": \"cash\",\n  \"coupon_code\": \"SAVE20\",\n  \"phone_code\": \"+966\",\n  \"phone\": \"501234567\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/app/orders",
              "host": ["{{base_url}}"],
              "path": ["api", "app", "orders"]
            }
          }
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8000",
      "type": "string"
    },
    {
      "key": "admin_token",
      "value": "your_admin_token_here",
      "type": "string"
    },
    {
      "key": "user_token",
      "value": "your_user_token_here",
      "type": "string"
    }
  ]
}
