{
    "info": {
        "name": "Service Authorization API",
        "_postman_id": "sp260-8f9e94eff4e2",
        "description": "Read a Georgia DFCS Service Authorization PDF and get structured JSON back.\n\n**Before you start**\n1. Set the `api_key` variable on this collection to a key from your account page.\n2. In *Extract a document*, pick the `file` row on the Body tab and choose a PDF -\n   Postman cannot store the file itself, so that row is empty on import.\n\nResponses are success/message/data, with YYYY-MM-DD dates, money as 2-decimal\nstrings, and services flattened to one row per client per service. With more than\none client, units and total_amount are null and should_ignore_units is true - the\nunits are a family pool the authorization does not split.\n\nEvery call is charged to your prepaid balance and the response reports what is left.\nA call that reaches a model is billed even if it fails to read the document; one\nrejected before a model runs is free.\n\nModels you can pass as `model` (optional, defaults to `@cf/meta/llama-4-scout-17b-16e-instruct`):\n  - @cf/meta/llama-4-scout-17b-16e-instruct\n  - @cf/google/gemma-4-26b-a4b-it\n  - @cf/mistralai/mistral-small-3.1-24b-instruct\n  - @cf/moonshotai/kimi-k2.7-code\n  - @cf/moonshotai/kimi-k2.6\n  - @cf/meta/llama-3.2-11b-vision-instruct\n  - @cf/openai/gpt-oss-120b  (text-layer PDFs only)\n  - @cf/openai/gpt-oss-20b  (text-layer PDFs only)\n  - google/gemini-2.5-flash\n  - @cf/meta/llama-3.3-70b-instruct-fp8-fast  (text-layer PDFs only)\n  - @cf/qwen/qwen3-30b-a3b-fp8  (text-layer PDFs only)\n  - @cf/zai-org/glm-4.7-flash  (text-layer PDFs only)",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [
        {
            "key": "base_url",
            "value": "https://sp330.getnums.com",
            "type": "string"
        },
        {
            "key": "api_key",
            "value": "",
            "type": "string"
        },
        {
            "key": "model",
            "value": "@cf/meta/llama-4-scout-17b-16e-instruct",
            "type": "string"
        }
    ],
    "item": [
        {
            "name": "Extract a document",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}",
                        "type": "text"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/extract.php",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "extract.php"
                    ]
                },
                "description": "Upload a PDF and get the case, its clients and every authorized service.\n\nPick a file on the Body tab before sending - the `file` row imports empty.\n\nA scanned or handwritten PDF has no text layer, so its pages must be rendered to\nimages first and posted as repeated `images[]` data URIs. Without them the API\nanswers `needs_page_images` and does not charge you. See *Extract a scan*.",
                "body": {
                    "mode": "formdata",
                    "formdata": [
                        {
                            "key": "file",
                            "type": "file",
                            "src": "",
                            "description": "The Service Authorization PDF. Required."
                        },
                        {
                            "key": "model",
                            "type": "text",
                            "value": "{{model}}",
                            "description": "Optional. Omit to use the default model."
                        }
                    ]
                }
            }
        },
        {
            "name": "Extract a scan (page images)",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}",
                        "type": "text"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/extract.php",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "extract.php"
                    ]
                },
                "description": "The JSON form, for a document you have already rasterised.\n\nOne data URI per page in `images`, in page order. `text` may be an empty string\nwhen the PDF has no text layer. Handwritten forms are read from these images.",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"filename\": \"scanned-authorization.pdf\",\n    \"text\": \"\",\n    \"images\": [\n        \"data:image/jpeg;base64,REPLACE_WITH_PAGE_1\",\n        \"data:image/jpeg;base64,REPLACE_WITH_PAGE_2\"\n    ],\n    \"page_count\": 2,\n    \"model\": \"{{model}}\"\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                }
            }
        },
        {
            "name": "Extract - native envelope (v1)",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}",
                        "type": "text"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/extract.php",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "extract.php"
                    ]
                },
                "description": "The older native envelope, kept for anything already built against it.\n\nThe DEFAULT response - what the other requests return, with no `format` at all -\nis success/message/data with YYYY-MM-DD dates and one service row per client.",
                "body": {
                    "mode": "formdata",
                    "formdata": [
                        {
                            "key": "file",
                            "type": "file",
                            "src": "",
                            "description": "The Service Authorization PDF. Required."
                        },
                        {
                            "key": "format",
                            "type": "text",
                            "value": "v1",
                            "description": "Opts out of the default response, returning the older native envelope."
                        }
                    ]
                }
            }
        },
        {
            "name": "Check balance",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}",
                        "type": "text"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/balance.php",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "balance.php"
                    ]
                },
                "description": "Your balance, spend over the last 30 days, and recent wallet activity.\n\nEvery extraction response already carries the balance after that charge, so this\nis mainly for checking before a large batch."
            }
        },
        {
            "name": "Usage history",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}",
                        "type": "text"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/usage.php?days=30",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "usage.php?days=30"
                    ]
                },
                "description": "Per-request history and a daily breakdown. Change `days` to widen the window."
            }
        },
        {
            "name": "List models",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}",
                        "type": "text"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/api/v1/models.php",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "models.php"
                    ]
                },
                "description": "Every model you may pass as `model`, with its price per page and whether it can\nread scans. Use this to validate an id before sending."
            }
        }
    ]
}