{
  "info": {
    "name": "MODAVA API Collection",
    "description": "Complete API collection for MODAVA fashion SaaS platform",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{access_token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:3000",
      "type": "string"
    },
    {
      "key": "access_token",
      "value": "",
      "type": "string"
    },
    {
      "key": "vendor_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "customer_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "invoice_id",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Health Check",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/health",
              "host": ["{{base_url}}"],
              "path": ["health"]
            }
          }
        }
      ]
    },
    {
      "name": "Authentication",
      "item": [
        {
          "name": "User Signup",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"vendor@example.com\",\n  \"password\": \"securepassword\",\n  \"business_name\": \"Fashion Studio\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/auth/signup",
              "host": ["{{base_url}}"],
              "path": ["api", "auth", "signup"]
            }
          }
        },
        {
          "name": "User Login",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"vendor@example.com\",\n  \"password\": \"securepassword\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/auth/login",
              "host": ["{{base_url}}"],
              "path": ["api", "auth", "login"]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 200) {",
                  "    const response = pm.response.json();",
                  "    if (response.data && response.data.access_token) {",
                  "        pm.collectionVariables.set('access_token', response.data.access_token);",
                  "        pm.collectionVariables.set('vendor_id', response.data.vendor.id);",
                  "    }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Get Profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/auth/profile",
              "host": ["{{base_url}}"],
              "path": ["api", "auth", "profile"]
            }
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/auth/logout",
              "host": ["{{base_url}}"],
              "path": ["api", "auth", "logout"]
            }
          }
        }
      ]
    },
    {
      "name": "Vendors",
      "item": [
        {
          "name": "Get My Profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/vendors/me",
              "host": ["{{base_url}}"],
              "path": ["api", "vendors", "me"]
            }
          }
        },
        {
          "name": "Complete Onboarding",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"business_name\": \"Fashion Studio\",\n  \"profile_picture_url\": \"https://example.com/profile.jpg\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/vendors/onboarding",
              "host": ["{{base_url}}"],
              "path": ["api", "vendors", "onboarding"]
            }
          }
        },
        {
          "name": "Update Profile",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"business_name\": \"Updated Fashion Studio\",\n  \"phone_number\": \"+1234567890\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/vendors/profile",
              "host": ["{{base_url}}"],
              "path": ["api", "vendors", "profile"]
            }
          }
        }
      ]
    },
    {
      "name": "Customers",
      "item": [
        {
          "name": "List Customers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/customers?search=&tag=",
              "host": ["{{base_url}}"],
              "path": ["api", "customers"],
              "query": [
                {
                  "key": "search",
                  "value": ""
                },
                {
                  "key": "tag",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Create Customer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"John Doe\",\n  \"phone\": \"+1234567890\",\n  \"email\": \"john@example.com\",\n  \"notes\": \"VIP customer\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/customers",
              "host": ["{{base_url}}"],
              "path": ["api", "customers"]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    const response = pm.response.json();",
                  "    if (response.data && response.data.id) {",
                  "        pm.collectionVariables.set('customer_id', response.data.id);",
                  "    }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Get Customer Profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/customers/{{customer_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "customers", "{{customer_id}}"]
            }
          }
        },
        {
          "name": "Update Customer",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"John Smith\",\n  \"phone\": \"+1987654321\",\n  \"notes\": \"Updated VIP customer\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/customers/{{customer_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "customers", "{{customer_id}}"]
            }
          }
        },
        {
          "name": "Update Measurements",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"name\": \"Chest\",\n    \"value\": \"42\",\n    \"unit\": \"inches\"\n  },\n  {\n    \"name\": \"Waist\",\n    \"value\": \"34\",\n    \"unit\": \"inches\"\n  },\n  {\n    \"name\": \"Hip\",\n    \"value\": \"44\",\n    \"unit\": \"inches\"\n  }\n]"
            },
            "url": {
              "raw": "{{base_url}}/api/customers/{{customer_id}}/measurements",
              "host": ["{{base_url}}"],
              "path": ["api", "customers", "{{customer_id}}", "measurements"]
            }
          }
        },
        {
          "name": "Delete Customer",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/customers/{{customer_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "customers", "{{customer_id}}"]
            }
          }
        }
      ]
    },
    {
      "name": "Invoices",
      "item": [
        {
          "name": "List Invoices",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/invoices",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices"]
            }
          }
        },
        {
          "name": "Create Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"customer_id\": \"{{customer_id}}\",\n  \"items\": [\n    {\n      \"name\": \"Custom Suit\",\n      \"quantity\": 1,\n      \"unit_price\": 299.99\n    },\n    {\n      \"name\": \"Fitting Session\",\n      \"quantity\": 1,\n      \"unit_price\": 50.00\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/invoices",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices"]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "    const response = pm.response.json();",
                  "    if (response.data && response.data.id) {",
                  "        pm.collectionVariables.set('invoice_id', response.data.id);",
                  "    }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Get Invoice Details",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/invoices/{{invoice_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices", "{{invoice_id}}"]
            }
          }
        },
        {
          "name": "Download PDF",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/invoices/{{invoice_id}}/download",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices", "{{invoice_id}}", "download"]
            }
          }
        },
        {
          "name": "Mark as Paid",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/invoices/{{invoice_id}}/mark-paid",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices", "{{invoice_id}}", "mark-paid"]
            }
          }
        },
        {
          "name": "List Transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/invoices/transactions",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices", "transactions"]
            }
          }
        },
        {
          "name": "Delete Invoice",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/invoices/{{invoice_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "invoices", "{{invoice_id}}"]
            }
          }
        }
      ]
    },
    {
      "name": "Reminders",
      "item": [
        {
          "name": "List Reminders",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/reminders/list",
              "host": ["{{base_url}}"],
              "path": ["api", "reminders", "list"]
            }
          }
        },
        {
          "name": "Create Reminder",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"customer_id\": \"{{customer_id}}\",\n  \"message\": \"Don't forget your fitting appointment tomorrow!\",\n  \"type\": \"follow-up\",\n  \"scheduled_at\": \"2024-01-15T10:00:00Z\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/reminders/create",
              "host": ["{{base_url}}"],
              "path": ["api", "reminders", "create"]
            }
          }
        },
        {
          "name": "Send Reminder",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/reminders/send/{{reminder_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "reminders", "send", "{{reminder_id}}"]
            }
          }
        }
      ]
    },
    {
      "name": "Subscriptions",
      "item": [
        {
          "name": "Get Plans",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/subscriptions/plans",
              "host": ["{{base_url}}"],
              "path": ["api", "subscriptions", "plans"]
            }
          }
        },
        {
          "name": "Get My Plan",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/subscriptions/my-plan",
              "host": ["{{base_url}}"],
              "path": ["api", "subscriptions", "my-plan"]
            }
          }
        },
        {
          "name": "Get Trial Offer",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/subscriptions/trial-offer",
              "host": ["{{base_url}}"],
              "path": ["api", "subscriptions", "trial-offer"]
            }
          }
        },
        {
          "name": "Accept Trial",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/subscriptions/accept-trial",
              "host": ["{{base_url}}"],
              "path": ["api", "subscriptions", "accept-trial"]
            }
          }
        },
        {
          "name": "Get Available Features",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/subscriptions/my-features",
              "host": ["{{base_url}}"],
              "path": ["api", "subscriptions", "my-features"]
            }
          }
        }
      ]
    },
    {
      "name": "KYC",
      "item": [
        {
          "name": "Submit KYC",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document_urls\": {\n    \"id_front\": \"https://example.com/id_front.jpg\",\n    \"id_back\": \"https://example.com/id_back.jpg\",\n    \"proof_of_address\": \"https://example.com/address.pdf\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/kyc/submit",
              "host": ["{{base_url}}"],
              "path": ["api", "kyc", "submit"]
            }
          }
        },
        {
          "name": "Get KYC Status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/kyc/status",
              "host": ["{{base_url}}"],
              "path": ["api", "kyc", "status"]
            }
          }
        }
      ]
    },
    {
      "name": "Market Prices",
      "item": [
        {
          "name": "Submit Price Report",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"item_id\": \"{{item_id}}\",\n  \"market_id\": \"{{market_id}}\",\n  \"price\": 25.99,\n  \"unit\": \"piece\",\n  \"notes\": \"Current market price for cotton fabric\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/market-prices",
              "host": ["{{base_url}}"],
              "path": ["api", "market-prices"]
            }
          }
        },
        {
          "name": "List Market Prices",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/market-prices",
              "host": ["{{base_url}}"],
              "path": ["api", "market-prices"]
            }
          }
        },
        {
          "name": "Get Price Suggestions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/market-prices/suggestions",
              "host": ["{{base_url}}"],
              "path": ["api", "market-prices", "suggestions"]
            }
          }
        }
      ]
    }
  ]
}
