{
  "info": {
    "name": "Vorrei Menu — Sandbox V2",
    "_postman_id": "c0c0a000-1111-2222-3333-444455556666",
    "description": "Esempi pronti per la Sandbox V2 (ordini da scontrino).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Lista ordini (base)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{api_key}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "{{accept_header}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api_v2.php?limit=50&cursor=0",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api_v2.php"
          ],
          "query": [
            {
              "key": "limit",
              "value": "50"
            },
            {
              "key": "cursor",
              "value": "0"
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Filtro per data",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{api_key}}",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "{{accept_header}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api_v2.php?date_from=2025-10-31&date_to=2025-11-01&limit=100",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api_v2.php"
          ],
          "query": [
            {
              "key": "date_from",
              "value": "2025-10-31"
            },
            {
              "key": "date_to",
              "value": "2025-11-01"
            },
            {
              "key": "limit",
              "value": "100"
            }
          ]
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test('Status 200', () => pm.response.to.have.status(200));",
              "const json = pm.response.json();",
              "pm.test('Versione V2', () => pm.expect(json.version).to.eql('v2'));",
              "pm.test('Array ordini', () => pm.expect(json.data).to.be.an('array'));"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "response": []
    },
    {
      "name": "Query string (alternativa)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "{{accept_header}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api_v2.php?limit=50&cursor=0&key={{api_key}}",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api_v2.php"
          ],
          "query": [
            {
              "key": "limit",
              "value": "50"
            },
            {
              "key": "cursor",
              "value": "0"
            },
            {
              "key": "key",
              "value": "{{api_key}}"
            }
          ]
        }
      },
      "response": []
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://sandbox.vorreimenu.it"
    },
    {
      "key": "api_key",
      "value": "INSERISCI_LA_TUA_CHIAVE"
    },
    {
      "key": "accept_header",
      "value": "application/vnd.vorrei.v2+json"
    }
  ]
}