{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d4e7aacb-9943-4499-8a07-633490ff5cbd","name":"TMS V3","description":"# TMS V3 (Integration Collection)\n\nThis collection contains integration endpoints used between external systems (e.g., HIS) and TMS/Odoo.\n\n## Getting started\n\n1. Select the environment **TMS-DEV**.\n    \n2. Ensure the following environment variables are set:\n    \n\n| Variable | Description | Example |\n| --- | --- | --- |\n| `Base_URL` | API host (scheme + hostname \\[+ port\\]) | `https://tms-dev.vgroupth.com` |\n| `Base_PATH` | Base path / prefix (often includes versioning) | `/api/v3` |\n| `APIKey` | API key used for requests (sent as `x-api-key`) | `****` |\n| `Login` | Username (used by authentication request if applicable) | `integration_user` |\n| `password` | Password (used by authentication request if applicable) | `****` |\n\n> Tip: keep `Base_URL` without a trailing slash and `Base_PATH` with a leading slash (or vice-versa), but be consistent so `{{Base_URL}}{{Base_PATH}}/...` resolves correctly. \n  \n\n## Authentication\n\nMost requests in this collection expect an API key in the header:\n\n- `x-api-key:`\n    \n\nSome deployments may also require a login/session step (see **IF017 Authentication** folder). If your API returns a token/cookie, you can store it in an environment variable and reference it in subsequent requests.\n\n## Common headers\n\nUnless stated otherwise per-request:\n\n- `Content-Type: application/json`\n    \n- `Accept: application/json`\n    \n- `x-api-key:`\n    \n\n## Common errors / troubleshooting\n\n- **401 / 403**: missing/invalid `x-api-key`, or key does not have access to the target database/company.\n    \n- **400**: schema validation errors (missing required fields, wrong date formats, invalid codes).\n    \n- **404**: wrong `Base_URL` / `Base_PATH` or endpoint path.\n    \n- **409**: duplicate `event_id` / idempotency conflicts (implementation-specific).\n    \n- **5xx**: server error. Check server logs using `meta.correlation_id`.\n    \n\n## Running the collection\n\n### Collection Runner (manual)\n\n- Use **Runner** to execute a folder (e.g., IF008 / IF017) or the entire collection.\n    \n- For event-driven APIs, use a data file (CSV/JSON) and parameterize fields like `{{mrn}}`, `{{encounter_id}}`, etc.\n    \n\n### Postman CLI (CI/CD)\n\n1. Login:\n    \n    ``` bash\n                  postman login --with-api-key PMAK-xxxxx\n    \n     ```\n    \n2. Run:\n    \n    ``` bash\n                  postman collection run 50495697-79882afd-5e27-4d92-b8c5-42e64ca12f34 -e 50495697-2308e3a2-6d83-482b-98b5-f3616ab97189\n    \n     ```\n    \n\n## Folder guide\n\n- **IF017 Authentication**: obtain/validate credentials for integrations (if required by your deployment).\n    \n- **IF008 Patien Encounter**: patient and encounter upsert flows.\n    \n- **IF009 Stock Dispense Create**: stock dispense creation events.\n    \n- **IF011 Notify Stock on Hand Change**: stock-on-hand notifications (if implemented).\n    \n- **IF017 Transaction Update**: transaction, invoice, payment, deposit, cancel flows.\n    \n\n## Notes on request payloads\n\nMost event-style endpoints follow an envelope pattern:\n\n- `meta`: tracking fields such as `event_id` and `correlation_id`\n    \n- `payload`: business content\n    \n\nWhen in doubt:\n\n- keep `meta.event_id` unique per submission\n    \n- reuse `meta.correlation_id` to trace a workflow across multiple related calls","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"50495697","team":11915455,"collectionId":"d4e7aacb-9943-4499-8a07-633490ff5cbd","publishedId":"2sBXinGVqR","public":true,"publicUrl":"https://api.tms.vgroupth.com","privateUrl":"https://go.postman.co/documentation/50495697-d4e7aacb-9943-4499-8a07-633490ff5cbd","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"0F9ED5"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"dark","themes":[{"name":"dark","logo":"https://content.pstmn.io/292c1147-ccd2-4b75-8f24-d9bfc1612adb/Rm9ybWFsIFJlY3RhbmdsZSAzMDB4MjAwICgzMjAgeCAxMzIgcHgpX1RyYW5zcGFyZW50LnBuZw==","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"0F9ED5"}},{"name":"light","logo":"https://content.pstmn.io/2f4c986c-d592-41e5-b77f-0ebe2d064e32/Rm9ybWFsIFJlY3RhbmdsZSAoMzIwIHggMTMyIHB4KV9UcmFuc3BhcmVudC5wbmc=","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"0F9ED5"}}]}},"version":"8.10.1","publishDate":"2026-03-30T09:01:20.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":"https://content.pstmn.io/2f4c986c-d592-41e5-b77f-0ebe2d064e32/Rm9ybWFsIFJlY3RhbmdsZSAoMzIwIHggMTMyIHB4KV9UcmFuc3BhcmVudC5wbmc=","logoDark":"https://content.pstmn.io/292c1147-ccd2-4b75-8f24-d9bfc1612adb/Rm9ybWFsIFJlY3RhbmdsZSAzMDB4MjAwICgzMjAgeCAxMzIgcHgpX1RyYW5zcGFyZW50LnBuZw=="}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/06d053bc100ec8077c020cd0404a69a675dbbd625c41685ac5fc373affbe1059","favicon":"https://vgroupth.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://api.tms.vgroupth.com/view/metadata/2sBXinGVqR"}