{
  "info": {
    "name": "ScanSureX Online Pharmacy \u2014 Prescription Verification API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Call these from a pharmacy backend. Set the collection variables: baseUrl (https://patient.scansurex.com/api/svc/dispensary/api/v1/online-pharmacy) and apiKey (ssx_test_\u2026 for sandbox, ssx_live_\u2026 for production). Idempotency-Key is unique per logical request; reuse it only to retry the same request."
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://patient.scansurex.com/api/svc/dispensary/api/v1/online-pharmacy"
    },
    {
      "key": "apiKey",
      "value": "ssx_test_PASTE_YOUR_KEY"
    },
    {
      "key": "verificationId",
      "value": "VER-2026-XXXXXXXX"
    }
  ],
  "item": [
    {
      "name": "0. Sandbox samples",
      "item": [
        {
          "name": "Download sample: valid-email (emailed PDF, collection QR)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sandbox/samples/valid-email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sandbox",
                "samples",
                "valid-email"
              ]
            },
            "description": "Save the response body as a .pdf (Send and Download in Postman)."
          }
        },
        {
          "name": "Download sample: valid-portal (portal PDF, verification QR)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sandbox/samples/valid-portal",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sandbox",
                "samples",
                "valid-portal"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Download sample: valid-photo (PNG photo of the prescription)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sandbox/samples/valid-photo",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sandbox",
                "samples",
                "valid-photo"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Download sample: expired",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sandbox/samples/expired",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sandbox",
                "samples",
                "expired"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Download sample: cancelled",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sandbox/samples/cancelled",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sandbox",
                "samples",
                "cancelled"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Download sample: tampered (genuine QR, altered text)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sandbox/samples/tampered",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sandbox",
                "samples",
                "tampered"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "1. Verify",
      "item": [
        {
          "name": "Verify by upload (PDF/JPG/PNG)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/prescriptions/verify/upload",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "prescriptions",
                "verify",
                "upload"
              ]
            },
            "description": "Attach the downloaded sample (or a real ScanSureX prescription PDF). Expect 201 with verification_status.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": ""
                }
              ]
            }
          }
        },
        {
          "name": "Verify by reference (no token \u2192 consent required)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/prescriptions/verify/reference",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "prescriptions",
                "verify",
                "reference"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference\": \"SSX-RX-HJQDLB\"\n}"
            }
          }
        },
        {
          "name": "Verify by reference + token (token from the QR)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/prescriptions/verify/reference",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "prescriptions",
                "verify",
                "reference"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference\": \"SSX-RX-HJQDLB\",\n  \"token\": \"PASTE_TOKEN_FROM_QR\"\n}"
            }
          }
        },
        {
          "name": "Get a verification by id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/verifications/{{verificationId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "verifications",
                "{{verificationId}}"
              ]
            },
            "description": ""
          }
        }
      ]
    },
    {
      "name": "2. Patient consent (photo / reference only)",
      "item": [
        {
          "name": "Request consent code (emailed to the patient)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/verifications/{{verificationId}}/consent/request",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "verifications",
                "{{verificationId}}",
                "consent",
                "request"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Confirm consent code \u2192 details released",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/verifications/{{verificationId}}/consent/confirm",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "verifications",
                "{{verificationId}}",
                "consent",
                "confirm"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"123456\"\n}"
            }
          }
        }
      ]
    },
    {
      "name": "3. Account",
      "item": [
        {
          "name": "Usage summary",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "usage"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "Recent verifications",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/verifications?limit=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "verifications?limit=20"
              ]
            },
            "description": ""
          }
        },
        {
          "name": "My API keys (prefixes only)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api-keys"
              ]
            },
            "description": ""
          }
        }
      ]
    }
  ]
}