{
  "info": {
    "_postman_id": "19c928eb-c873-4f10-9f29-0d5f8f2ac0c5",
    "name": "new_1m_market API",
    "description": "Postman collection for the Laravel API with seeded admin, vendor, and driver accounts plus example client flows. Seed assumptions: `php artisan db:seed` has been run. Seeded credentials use password `123456789`. Client users are not seeded, so start with the register/verify/login requests or swap in an existing client account.\n\nHeaders by area:\n- Client: `user-type: client`, `Agent-Token: {{agentToken}}`\n- Driver: `user-type: driver`, `Agent-Token: {{agentToken}}`\n- Vendor: `user-type: vendor`\n- Admin: `user-type: admin`\n\nStandard JSON envelope:\n`{ status, message, data }`",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "http://localhost:8000/api" },
    { "key": "locale", "value": "en" },
    { "key": "agentToken", "value": "postman-device-001" },
    { "key": "adminEmail", "value": "admin@gmail.com" },
    { "key": "adminPassword", "value": "123456789" },
    { "key": "vendorEmail", "value": "vendor1@gmail.com" },
    { "key": "vendorUsername", "value": "vendor1" },
    { "key": "vendorPassword", "value": "123456789" },
    { "key": "driverPhoneCode", "value": "966" },
    { "key": "driverPhone", "value": "510000001" },
    { "key": "driverPassword", "value": "123456789" },
    { "key": "clientPhoneCode", "value": "966" },
    { "key": "clientPhone", "value": "512345678" },
    { "key": "clientPassword", "value": "123456789" },
    { "key": "clientName", "value": "Postman Client" },
    { "key": "clientToken", "value": "" },
    { "key": "adminToken", "value": "" },
    { "key": "vendorToken", "value": "" },
    { "key": "driverToken", "value": "" },
    { "key": "countryId", "value": "1" },
    { "key": "cityId", "value": "1" },
    { "key": "locationId", "value": "1" },
    { "key": "productId", "value": "1" },
    { "key": "variantId", "value": "" },
    { "key": "vendorId", "value": "2" },
    { "key": "driverId", "value": "5" },
    { "key": "couponCode", "value": "SAVE10" },
    { "key": "orderId", "value": "1" },
    { "key": "orderGroupId", "value": "1" },
    { "key": "creditId", "value": "1" },
    { "key": "paymentSessionReference", "value": "" }
  ],
  "item": [
    {
      "name": "General",
      "item": [
        {
          "name": "Countries",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" }
            ],
            "url": "{{baseUrl}}/general/countries"
          }
        },
        {
          "name": "Cities",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" }
            ],
            "url": "{{baseUrl}}/general/cities"
          }
        },
        {
          "name": "Brands",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" }
            ],
            "url": "{{baseUrl}}/general/brands"
          }
        },
        {
          "name": "Categories",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" }
            ],
            "url": "{{baseUrl}}/general/categories"
          }
        }
      ]
    },
    {
      "name": "Client",
      "item": [
        {
          "name": "Auth",
          "item": [
            {
              "name": "Register Client",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"{{clientName}}\",\n  \"phone_code\": \"{{clientPhoneCode}}\",\n  \"phone\": \"{{clientPhone}}\",\n  \"password\": \"{{clientPassword}}\"\n}"
                },
                "url": "{{baseUrl}}/app/client/auth/register"
              }
            },
            {
              "name": "Verify Client OTP",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"auth\": \"{{clientPhone}}\",\n  \"phone_code\": \"{{clientPhoneCode}}\",\n  \"code\": \"1111\"\n}"
                },
                "url": "{{baseUrl}}/app/client/auth/verify"
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "let json = {};",
                      "try { json = pm.response.json(); } catch (e) {}",
                      "const token = json?.data?.token || json?.data?.access_token;",
                      "if (token) pm.collectionVariables.set('clientToken', token);"
                    ]
                  }
                }
              ]
            },
            {
              "name": "Login Client",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"auth\": \"{{clientPhone}}\",\n  \"phone_code\": \"{{clientPhoneCode}}\",\n  \"password\": \"{{clientPassword}}\",\n  \"device_token\": \"postman-fcm-token\",\n  \"device_type\": \"android\"\n}"
                },
                "url": "{{baseUrl}}/app/client/auth/login"
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "let json = {};",
                      "try { json = pm.response.json(); } catch (e) {}",
                      "const token = json?.data?.token || json?.data?.access_token;",
                      "if (token) pm.collectionVariables.set('clientToken', token);"
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "Browse",
          "item": [
            {
              "name": "Home",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/home"
              }
            },
            {
              "name": "Products",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/products"
              }
            },
            {
              "name": "Show Product",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/product/{{productId}}/show"
              }
            },
            {
              "name": "List Coupons",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/coupons"
              }
            }
          ]
        },
        {
          "name": "Profile And Location",
          "item": [
            {
              "name": "Show Profile",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/profile"
              }
            },
            {
              "name": "Create Location",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"lat\": 24.7136,\n  \"lng\": 46.6753,\n  \"name\": \"Home\",\n  \"property_number\": \"Building 5\",\n  \"details\": \"Near mall\",\n  \"city_id\": {{cityId}},\n  \"is_default\": \"1\"\n}"
                },
                "url": "{{baseUrl}}/app/client/locations"
              }
            },
            {
              "name": "List Locations",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/locations"
              }
            }
          ]
        },
        {
          "name": "Cart And Orders",
          "item": [
            {
              "name": "Add To Cart",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"product_id\": {{productId}},\n  \"variant_id\": null,\n  \"quantity\": 1,\n  \"action\": \"increment\"\n}"
                },
                "url": "{{baseUrl}}/app/client/cart"
              }
            },
            {
              "name": "Show Cart",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/cart"
              }
            },
            {
              "name": "Create Order",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"location_id\": {{locationId}},\n  \"delivery_method\": \"delivery\",\n  \"distance\": 5.2,\n  \"coupon_code\": \"{{couponCode}}\",\n  \"vendor_payments\": {\n    \"{{vendorId}}\": \"online\"\n  }\n}"
                },
                "url": "{{baseUrl}}/app/client/orders"
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "let json = {};",
                      "try { json = pm.response.json(); } catch (e) {}",
                      "const ref = json?.data?.reference;",
                      "if (ref) pm.collectionVariables.set('paymentSessionReference', ref);"
                    ]
                  }
                }
              ]
            },
            {
              "name": "List Orders",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/orders"
              }
            },
            {
              "name": "Show Order",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/orders/{{orderGroupId}}"
              }
            }
          ]
        },
        {
          "name": "Deferred Invoices",
          "item": [
            {
              "name": "Create Deferred Invoice Request",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"vendor_id\": {{vendorId}},\n  \"phone_code\": \"{{clientPhoneCode}}\",\n  \"phone\": \"{{clientPhone}}\",\n  \"identity\": \"1\"\n}"
                },
                "url": "{{baseUrl}}/app/client/deferred-invoices"
              }
            },
            {
              "name": "Deferred Credits",
              "request": {
                "method": "GET",
                "header": [
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "url": "{{baseUrl}}/app/client/deferred-invoices/credits"
              }
            },
            {
              "name": "Pay Credit",
              "request": {
                "method": "POST",
                "header": [
                  { "key": "Content-Type", "value": "application/json" },
                  { "key": "Accept-Language", "value": "{{locale}}" },
                  { "key": "Authorization", "value": "Bearer {{clientToken}}" },
                  { "key": "user-type", "value": "client" },
                  { "key": "Agent-Token", "value": "{{agentToken}}" }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"payment_method\": \"online\"\n}"
                },
                "url": "{{baseUrl}}/app/client/deferred-invoices/credits/{{creditId}}/pay"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Admin",
      "item": [
        {
          "name": "Login Admin",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "user-type", "value": "admin" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"auth\": \"{{adminEmail}}\",\n  \"password\": \"{{adminPassword}}\"\n}"
            },
            "url": "{{baseUrl}}/dashboard/admin/login"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "let json = {};",
                  "try { json = pm.response.json(); } catch (e) {}",
                  "const token = json?.data?.token || json?.data?.access_token;",
                  "if (token) pm.collectionVariables.set('adminToken', token);"
                ]
              }
            }
          ]
        },
        {
          "name": "Admin Profile",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{adminToken}}" },
              { "key": "user-type", "value": "admin" }
            ],
            "url": "{{baseUrl}}/dashboard/admin/profile"
          }
        },
        {
          "name": "List Vendors",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{adminToken}}" },
              { "key": "user-type", "value": "admin" }
            ],
            "url": "{{baseUrl}}/dashboard/admin/vendors"
          }
        },
        {
          "name": "List Drivers",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{adminToken}}" },
              { "key": "user-type", "value": "admin" }
            ],
            "url": "{{baseUrl}}/dashboard/admin/drivers"
          }
        },
        {
          "name": "Accept Driver",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{adminToken}}" },
              { "key": "user-type", "value": "admin" }
            ],
            "url": "{{baseUrl}}/dashboard/admin/drivers/{{driverId}}/accept"
          }
        },
        {
          "name": "List Payments",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{adminToken}}" },
              { "key": "user-type", "value": "admin" }
            ],
            "url": "{{baseUrl}}/dashboard/admin/payments"
          }
        }
      ]
    },
    {
      "name": "Vendor",
      "item": [
        {
          "name": "Login Vendor",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "user-type", "value": "vendor" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"auth\": \"{{vendorEmail}}\",\n  \"password\": \"{{vendorPassword}}\"\n}"
            },
            "url": "{{baseUrl}}/dashboard/vendor/login"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "let json = {};",
                  "try { json = pm.response.json(); } catch (e) {}",
                  "const token = json?.data?.token || json?.data?.access_token;",
                  "if (token) pm.collectionVariables.set('vendorToken', token);"
                ]
              }
            }
          ]
        },
        {
          "name": "Vendor Profile",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{vendorToken}}" },
              { "key": "user-type", "value": "vendor" }
            ],
            "url": "{{baseUrl}}/dashboard/vendor/profile"
          }
        },
        {
          "name": "Vendor Wallet",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{vendorToken}}" },
              { "key": "user-type", "value": "vendor" }
            ],
            "url": "{{baseUrl}}/dashboard/vendor/wallet"
          }
        },
        {
          "name": "Vendor Orders",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{vendorToken}}" },
              { "key": "user-type", "value": "vendor" }
            ],
            "url": "{{baseUrl}}/dashboard/vendor/orders"
          }
        }
      ]
    },
    {
      "name": "Driver",
      "item": [
        {
          "name": "Login Driver",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "user-type", "value": "driver" },
              { "key": "Agent-Token", "value": "{{agentToken}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"auth\": \"{{driverPhone}}\",\n  \"phone_code\": \"{{driverPhoneCode}}\",\n  \"password\": \"{{driverPassword}}\",\n  \"device_token\": \"postman-driver-token\",\n  \"device_type\": \"android\"\n}"
            },
            "url": "{{baseUrl}}/app/driver/auth/login"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "let json = {};",
                  "try { json = pm.response.json(); } catch (e) {}",
                  "const token = json?.data?.token || json?.data?.access_token;",
                  "if (token) pm.collectionVariables.set('driverToken', token);"
                ]
              }
            }
          ]
        },
        {
          "name": "Driver Profile",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{driverToken}}" },
              { "key": "user-type", "value": "driver" },
              { "key": "Agent-Token", "value": "{{agentToken}}" }
            ],
            "url": "{{baseUrl}}/app/driver/profile"
          }
        },
        {
          "name": "Driver Home",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{driverToken}}" },
              { "key": "user-type", "value": "driver" },
              { "key": "Agent-Token", "value": "{{agentToken}}" }
            ],
            "url": "{{baseUrl}}/app/driver/home"
          }
        },
        {
          "name": "Driver My Orders",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" },
              { "key": "Authorization", "value": "Bearer {{driverToken}}" },
              { "key": "user-type", "value": "driver" },
              { "key": "Agent-Token", "value": "{{agentToken}}" }
            ],
            "url": "{{baseUrl}}/app/driver/my-orders"
          }
        }
      ]
    },
    {
      "name": "MyFatoorah",
      "item": [
        {
          "name": "Callback Endpoint Example",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" }
            ],
            "url": "{{baseUrl}}/general/payments/myfatoorah/callback?reference={{paymentSessionReference}}&paymentId=test-payment-id"
          }
        },
        {
          "name": "Error Endpoint Example",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept-Language", "value": "{{locale}}" }
            ],
            "url": "{{baseUrl}}/general/payments/myfatoorah/error?reference={{paymentSessionReference}}&Error=Payment+Cancelled"
          }
        }
      ]
    }
  ]
}
