{
  "info": {
    "name": "ParcelXpert REST API v1 — sandbox integration",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Import the accompanying environment and set its secret PX_API_KEY locally. Run folders 01 then 02. Other folders are manual, capability-dependent recipes. Synthetic shipping only; live keys, payments and postage are disabled. Never export populated environments or send the whole collection blindly."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{PX_API_KEY}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "if (pm.variables.replaceIn('{{PX_BASE_URL}}') !== 'https://sandbox-api.parcelxpert.com/v1') { pm.execution.skipRequest(); throw new Error('This test collection is restricted to the public PX sandbox.'); }",
          "if (!/^px_test_[a-f0-9]{64}$/.test(pm.variables.replaceIn('{{PX_API_KEY}}'))) { pm.execution.skipRequest(); throw new Error('Set your approved TEST key privately in the imported environment.'); }",
          "if (!pm.environment.get('PX_MERCHANT_REFERENCE')) pm.environment.set('PX_MERCHANT_REFERENCE','integration-'+pm.variables.replaceIn('{{$guid}}'));"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "01 Quote and book — run first",
      "item": [
        {
          "name": "Get quotes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{PX_BASE_URL}}/quotes",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Route fixtures support GB, FR, DE, IE, US, CA and AU. Per-parcel limits: 70 kg and 150 cm each dimension. Expiry 15 minutes. Domestic fixture VAT 20%; cross-border fixtures show zero VAT without making a tax determination.\n\nScope: quotes:read. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"collection_country\": \"GB\",\n  \"collection_postcode\": \"NN1 1AA\",\n  \"delivery_country\": \"GB\",\n  \"delivery_postcode\": \"SW1A 1AA\",\n  \"parcels\": [\n    {\n      \"weight\": 2,\n      \"length\": 30,\n      \"width\": 20,\n      \"height\": 15\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));",
                  "if (pm.response.code === 200) { const offer=pm.response.json().data.find(q => q.handover === 'drop_off'); if (offer) pm.environment.set('PX_QUOTE_ID',offer.id); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create shipment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_Createshipment}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/shipments",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Mandatory Idempotency-Key. Account-scoped durable replay across credentials returns the original 201 body and Idempotency-Replayed. Different payload returns 409. International shipments require DAP customs; collection services require a schedule.\nIntended live billing belongs to the mapped PX shipping account. Live saved-card charges and carrier purchases remain disabled pending certification and a separately approved bounded pilot. Sandbox payment outcomes are simulated. A declined chosen card returns 402; authentication or reconciliation required returns 409. Complete authentication in the authorised PX account and continue the original idempotent booking. Suppliers and their finances are behind the PX abstraction.\n\nScope: shipments:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quote_id\": \"{{PX_QUOTE_ID}}\",\n  \"sender\": {\n    \"name\": \"Test Sender\",\n    \"line1\": \"1 Test Street\",\n    \"city\": \"Northampton\",\n    \"postcode\": \"NN1 1AA\",\n    \"country\": \"GB\",\n    \"email\": \"sender@example.invalid\",\n    \"phone\": \"+441234567890\"\n  },\n  \"recipient\": {\n    \"name\": \"Test Recipient\",\n    \"line1\": \"1 Test Street\",\n    \"city\": \"London\",\n    \"postcode\": \"SW1A 1AA\",\n    \"country\": \"GB\",\n    \"email\": \"recipient@example.invalid\",\n    \"phone\": \"+441234567890\"\n  },\n  \"parcels\": [\n    {\n      \"weight\": 2,\n      \"length\": 30,\n      \"width\": 20,\n      \"height\": 15\n    }\n  ],\n  \"contents\": \"Cotton T-shirts\",\n  \"merchant_reference\": \"{{PX_MERCHANT_REFERENCE}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_QUOTE_ID')) { pm.execution.skipRequest(); throw new Error('Request a fresh quote first.'); }",
                  "if (!pm.environment.get('PX_IDEMPOTENCY_Createshipment')) pm.environment.set('PX_IDEMPOTENCY_Createshipment', pm.variables.replaceIn('{{$guid}}'));"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([201]));",
                  "if (pm.response.code === 201) { const shipment=pm.response.json(); pm.environment.set('PX_SHIPMENT_ID',shipment.id); if (shipment.tracking_number) pm.environment.set('PX_TRACKING_NUMBER',shipment.tracking_number); }"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "02 Read, label and tracking",
      "item": [
        {
          "name": "List shipments",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/shipments?limit=20&merchant_reference={{PX_MERCHANT_REFERENCE}}",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Mandatory Idempotency-Key. Account-scoped durable replay across credentials returns the original 201 body and Idempotency-Replayed. Different payload returns 409. International shipments require DAP customs; collection services require a schedule.\n\nScope: shipments:read. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Retrieve shipment",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/shipments/{{PX_SHIPMENT_ID}}",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. \n\nScope: shipments:read. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Download label",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/shipments/{{PX_SHIPMENT_ID}}/label?format=a4",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. \n\nScope: labels:read. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));",
                  "pm.test('PDF label', () => pm.expect(pm.response.headers.get('Content-Type')).to.include('application/pdf')); "
                ]
              }
            }
          ]
        },
        {
          "name": "Retrieve tracking",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/shipments/{{PX_SHIPMENT_ID}}/tracking",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. \n\nScope: tracking:read. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Find tracking by number",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/tracking/{{PX_TRACKING_NUMBER}}",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. \n\nScope: tracking:read. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_TRACKING_NUMBER')) { pm.execution.skipRequest(); throw new Error('Set PX_TRACKING_NUMBER from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "03 Optional manual recipes — read prerequisites",
      "item": [
        {
          "name": "Request cancellation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_Requestcancellation}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/shipments/{{PX_SHIPMENT_ID}}/cancel",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled.  Production accepts an eligible cancellation request through the existing PX customer cancellation workflow. It does not confirm a carrier cancellation or refund.\n\nScope: shipments:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Order cancelled\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_Requestcancellation')) pm.environment.set('PX_IDEMPOTENCY_Requestcancellation', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200,202]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Confirm collection schedule",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_Confirmcollectionschedule}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/shipments/{{PX_SHIPMENT_ID}}/collection",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled.  Production collection modification is unavailable; collection at initial booking follows the selected PX service.\n\nScope: collections:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"date\": \"{{PX_COLLECTION_DATE}}\",\n  \"ready_time\": \"09:00\",\n  \"close_time\": \"17:00\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_Confirmcollectionschedule')) pm.environment.set('PX_IDEMPOTENCY_Confirmcollectionschedule', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }",
                  "if (!pm.environment.get('PX_COLLECTION_DATE')) { pm.execution.skipRequest(); throw new Error('Use a collection-capable quote and explicitly set a future YYYY-MM-DD date within 30 days.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Register webhook endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_Registerwebhookendpoint}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/webhook-endpoints",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Application-scoped sandbox subscriptions. HTTPS public destinations only. Worker runs outside booking transactions. Signing secret appears once on first registration; idempotent repeats omit it.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"{{PX_WEBHOOK_URL}}\",\n  \"event_types\": [\n    \"shipment.booked\",\n    \"tracking.updated\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_Registerwebhookendpoint')) pm.environment.set('PX_IDEMPOTENCY_Registerwebhookendpoint', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!String(pm.environment.get('PX_WEBHOOK_URL') || '').startsWith('https://')) { pm.execution.skipRequest(); throw new Error('Set your authorised public HTTPS test receiver first. Never use customer production endpoints.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([201]));",
                  "// Save the one-time signing secret directly to your backend secret manager; this collection never logs or persists it.",
                  "if (pm.response.code === 201) pm.environment.set('PX_WEBHOOK_ID',pm.response.json().id);"
                ]
              }
            }
          ]
        },
        {
          "name": "List webhook endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/webhook-endpoints",
            "description": "Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Application-scoped sandbox subscriptions. HTTPS public destinations only. Worker runs outside booking transactions. Signing secret appears once on first registration; idempotent repeats omit it.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "Advance sandbox Shipment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_AdvanceSandboxShipment}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/sandbox/shipments/{{PX_SHIPMENT_ID}}/events",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled.\n\nScope: shipments:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"in_transit\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_AdvanceSandboxShipment')) pm.environment.set('PX_IDEMPOTENCY_AdvanceSandboxShipment', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "UpdateWebhook",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_UpdateWebhook}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/webhook-endpoints/{{PX_WEBHOOK_ID}}",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_UpdateWebhook')) pm.environment.set('PX_IDEMPOTENCY_UpdateWebhook', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_WEBHOOK_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_WEBHOOK_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "WebhookDeliveries",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/webhook-endpoints/{{PX_WEBHOOK_ID}}/deliveries",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_WEBHOOK_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_WEBHOOK_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "RotateWebhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_RotateWebhook}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/webhook-endpoints/{{PX_WEBHOOK_ID}}/rotate-secret",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_RotateWebhook')) pm.environment.set('PX_IDEMPOTENCY_RotateWebhook', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_WEBHOOK_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_WEBHOOK_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "TestWebhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_TestWebhook}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/webhook-endpoints/{{PX_WEBHOOK_ID}}/test",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"shipment_id\": \"{{PX_SHIPMENT_ID}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_TestWebhook')) pm.environment.set('PX_IDEMPOTENCY_TestWebhook', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_WEBHOOK_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_WEBHOOK_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "ReplayWebhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_ReplayWebhook}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/webhook-endpoints/{{PX_WEBHOOK_ID}}/replay",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_id\": \"{{PX_WEBHOOK_EVENT_ID}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_ReplayWebhook')) pm.environment.set('PX_IDEMPOTENCY_ReplayWebhook', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_WEBHOOK_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_WEBHOOK_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        },
        {
          "name": "DispatchWebhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{PX_IDEMPOTENCY_DispatchWebhook}}"
              }
            ],
            "url": "{{PX_BASE_URL}}/webhook-endpoints/{{PX_WEBHOOK_ID}}/dispatch",
            "description": "Sandbox only. Organisation/application scoped, authenticated and rate limited. Idempotent management writes; signing secrets are never recoverable. Dispatch attempts one due delivery without bypassing its retry schedule. Live API disabled. Each call processes at most one due delivery or returns idle; this worker diagnostic does not cache/replay its response. Repeated calls may claim different events. Retry eligibility remains enforced and consumers deduplicate event IDs.\n\nScope: webhooks:write. Availability: sandbox. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_IDEMPOTENCY_DispatchWebhook')) pm.environment.set('PX_IDEMPOTENCY_DispatchWebhook', pm.variables.replaceIn('{{$guid}}'));",
                  "if (!pm.environment.get('PX_WEBHOOK_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_WEBHOOK_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([200]));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "04 Unavailable operations — explicit exclusions",
      "item": [
        {
          "name": "List imported orders — unavailable (422)",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/orders",
            "description": "Imported marketplace orders are not available in the external sandbox. With orders:read, returns 422 operation_not_enabled. No customer order query or import occurs. Live operation is not certified.\n\nScope: orders:read. Availability: unavailable. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([422]));",
                  "pm.test('Explicitly unavailable', () => pm.expect(pm.response.json().error.code).to.equal('operation_not_enabled')); "
                ]
              }
            }
          ]
        },
        {
          "name": "Retrieve imported order — unavailable (422)",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{PX_BASE_URL}}/orders/{{PX_SHIPMENT_ID}}",
            "description": "Imported marketplace orders are not available in the external sandbox. With orders:read, returns 422 operation_not_enabled. No customer order query or import occurs. Live operation is not certified.\n\nScope: orders:read. Availability: unavailable. Keep each write's saved idempotency variable and exact body for retries. Optional folders are manual recipes, not a full-collection acceptance run."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('PX_SHIPMENT_ID')) { pm.execution.skipRequest(); throw new Error('Set PX_SHIPMENT_ID from the original successful response first.'); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('PX request ID is returned', () => pm.expect(pm.response.headers.get('X-Request-ID')).to.match(/^req_/));",
                  "pm.test('Expected HTTP result', () => pm.expect(pm.response.code).to.be.oneOf([422]));",
                  "pm.test('Explicitly unavailable', () => pm.expect(pm.response.json().error.code).to.equal('operation_not_enabled')); "
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}