Skip to Content
InternalDocsPostmanRGL8R API.postman Collection

RGL8R API.postman Collection

Source: docs/postman/RGL8R-API.postman_collection.json

{ "info": { "_postman_id": "rgl8r-api-collection", "name": "RGL8R API", "description": "RGL8R Compliance OS API - Landed cost pricing, import/export compliance, and regulatory management.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "variable": [ { "key": "BASE_URL", "value": "http://localhost:3001", "type": "string" }, { "key": "API_KEY", "value": "rgl8r_dev_key_1", "type": "string" }, { "key": "ORG_ID", "value": "00000000-0000-0000-0000-000000000001", "type": "string" }, { "key": "tenantId", "value": "00000000-0000-0000-0000-000000000001", "type": "string" }, { "key": "GUEST_EMAIL", "value": "guest@example.com", "type": "string" }, { "key": "GUEST_ACCESS_TOKEN", "value": "", "type": "string" }, { "key": "GUEST_SESSION_ID", "value": "", "type": "string" }, { "key": "GUEST_SHARE_TOKEN", "value": "", "type": "string" } ], "auth": { "type": "apikey", "apikey": [ { "key": "key", "value": "x-api-key", "type": "string" }, { "key": "value", "value": "{{API_KEY}}", "type": "string" }, { "key": "in", "value": "header", "type": "string" } ] }, "item": [ { "name": "Health", "item": [ { "name": "Health Check", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "{{BASE_URL}}/health", "host": [ "{{BASE_URL}}" ], "path": [ "health" ] }, "description": "Check API health status. No authentication required." } } ] }, { "name": "Auth", "item": [ { "name": "Token Exchange", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/auth/token", "host": [ "{{BASE_URL}}" ], "path": [ "api", "auth", "token" ] }, "description": "Exchange API key + org ID for a short-lived JWT. Returns access_token (Bearer), token_type, and expires_in (seconds)." } } ] }, { "name": "Guest (P2A-D)", "item": [ { "name": "Create Guest Token", "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"email\": \"{{GUEST_EMAIL}}\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/guest/token", "host": [ "{{BASE_URL}}" ], "path": [ "api", "guest", "token" ] }, "description": "Create a guest audit session and short-lived access token. Save response sessionId and accessToken into collection variables before upload/status calls." } }, { "name": "Upload Guest File", "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "Authorization", "value": "Bearer {{GUEST_ACCESS_TOKEN}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Guest upload file (TRADE uses XLSX; SHIP currently disabled in handler)" }, { "key": "module", "value": "trade", "type": "text", "description": "Guest module enum" } ] }, "url": { "raw": "{{BASE_URL}}/api/guest/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "guest", "upload" ] }, "description": "Upload one file for this guest session. One session allows a single upload; repeat upload returns 409." } }, { "name": "Get Guest Session", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{GUEST_ACCESS_TOKEN}}" } ], "url": { "raw": "{{BASE_URL}}/api/guest/sessions/:sessionId", "host": [ "{{BASE_URL}}" ], "path": [ "api", "guest", "sessions", ":sessionId" ], "variable": [ { "key": "sessionId", "value": "{{GUEST_SESSION_ID}}", "description": "Guest session ID from token response" } ] }, "description": "Get guest session processing status and summary result (when completed). Access token must match the same session ID." } }, { "name": "Create Guest Share Link", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{GUEST_ACCESS_TOKEN}}" } ], "url": { "raw": "{{BASE_URL}}/api/guest/sessions/:sessionId/share", "host": [ "{{BASE_URL}}" ], "path": [ "api", "guest", "sessions", ":sessionId", "share" ], "variable": [ { "key": "sessionId", "value": "{{GUEST_SESSION_ID}}", "description": "Completed guest session ID" } ] }, "description": "Generate a public share link for a completed guest summary. shareExpiresAt/expiresAt is a maximum bound; TTL purge may invalidate access earlier once the session is purged." } }, { "name": "Get Shared Guest Summary", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "{{BASE_URL}}/api/guest/shared/:shareToken", "host": [ "{{BASE_URL}}" ], "path": [ "api", "guest", "shared", ":shareToken" ], "variable": [ { "key": "shareToken", "value": "{{GUEST_SHARE_TOKEN}}", "description": "Share token returned from share link endpoint" } ] }, "description": "Fetch the sanitized guest summary via public share token. If the backing session was TTL-purged, this can fail before token expiry." } } ] }, { "name": "Uploads", "item": [ { "name": "Upload Catalog", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Excel file (.xlsx, .xls)" }, { "key": "runPolicy", "value": "always", "type": "text", "description": "Optional: use \"skip_exact_duplicates\" to skip exact repeats" } ] }, "url": { "raw": "{{BASE_URL}}/api/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "upload" ] }, "description": "Upload Excel file for async processing. Returns jobId for status polling." } }, { "name": "Get Job Status", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/jobs/:jobId", "host": [ "{{BASE_URL}}" ], "path": [ "api", "jobs", ":jobId" ], "variable": [ { "key": "jobId", "value": "your-job-id-here", "description": "Job ID from upload response" } ] }, "description": "Get status and result of a upload job." }, "response": [ { "name": "Example - Job Detail", "originalRequest": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/jobs/:jobId", "host": [ "{{BASE_URL}}" ], "path": [ "api", "jobs", ":jobId" ], "variable": [ { "key": "jobId", "value": "f610fc8f-6547-4b4e-a8c5-4f7713eacf09" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"id\": \"f610fc8f-6547-4b4e-a8c5-4f7713eacf09\",\n \"type\": \"catalog_upload\",\n \"status\": \"completed\",\n \"progress\": 100,\n \"fileName\": \"Sample Catalog Data.xlsx\",\n \"result\": {\n \"atRisk\": 25,\n \"cleared\": 1445,\n \"fileName\": \"Sample Catalog Data.xlsx\",\n \"processed\": 1500,\n \"totalSkus\": 1500,\n \"needsReview\": 30,\n \"rowsIngested\": 52516,\n \"errorsSkipped\": 0,\n \"falsePositive\": 0,\n \"coveredSubsetCount\": 64\n },\n \"reconciliation\": {\n \"rowsUploaded\": 52516,\n \"rowsSkipped\": 0,\n \"rowsDeduplicated\": 51016,\n \"skusFound\": 1500,\n \"skusScreened\": 64,\n \"skusNotApplicable\": 1436\n },\n \"skippedRows\": {\n \"counts\": {\n \"MISSING_SKU\": 0,\n \"EMPTY_ROW\": 0\n },\n \"sample\": []\n },\n \"warnings\": {\n \"missingHs\": 0,\n \"invalidHs\": 0,\n \"lowHsConfidence\": 30,\n \"missingCountry\": 12,\n \"invalidCountry\": 2,\n \"lowCountryConfidence\": 5,\n \"missingMaterial\": 9,\n \"unclassifiedMaterial\": 4,\n \"lowMaterialConfidence\": 6\n },\n \"outcomes\": {\n \"atRisk\": 25,\n \"cleared\": 1445,\n \"needsReview\": 30,\n \"falsePositive\": 0\n },\n \"error\": null,\n \"createdAt\": \"2026-01-16T00:12:43.756Z\",\n \"updatedAt\": \"2026-01-16T00:12:49.897Z\"\n}" } ] }, { "name": "List Jobs", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/jobs?status=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "jobs" ], "query": [ { "key": "status", "value": "", "description": "Filter by status (pending, processing, completed, failed)" }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "List all jobs for this tenant." }, "response": [ { "name": "Example - Job List", "originalRequest": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/jobs?status=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "jobs" ], "query": [ { "key": "status", "value": "" }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"jobs\": [\n {\n \"id\": \"f610fc8f-6547-4b4e-a8c5-4f7713eacf09\",\n \"type\": \"catalog_upload\",\n \"status\": \"completed\",\n \"progress\": 100,\n \"fileName\": \"Sample Catalog Data.xlsx\",\n \"result\": {\n \"atRisk\": 25,\n \"cleared\": 1445,\n \"processed\": 1500,\n \"totalSkus\": 1500,\n \"needsReview\": 30,\n \"rowsIngested\": 52516,\n \"errorsSkipped\": 0,\n \"falsePositive\": 0,\n \"coveredSubsetCount\": 64\n },\n \"reconciliation\": {\n \"rowsUploaded\": 52516,\n \"rowsSkipped\": 0,\n \"rowsDeduplicated\": 51016,\n \"skusFound\": 1500,\n \"skusScreened\": 64,\n \"skusNotApplicable\": 1436\n },\n \"skippedRows\": {\n \"counts\": {\n \"MISSING_SKU\": 0,\n \"EMPTY_ROW\": 0\n }\n },\n \"warnings\": {\n \"missingHs\": 0,\n \"invalidHs\": 0,\n \"lowHsConfidence\": 30,\n \"missingCountry\": 12,\n \"invalidCountry\": 2,\n \"lowCountryConfidence\": 5,\n \"missingMaterial\": 9,\n \"unclassifiedMaterial\": 4,\n \"lowMaterialConfidence\": 6\n },\n \"outcomes\": {\n \"atRisk\": 25,\n \"cleared\": 1445,\n \"needsReview\": 30,\n \"falsePositive\": 0\n },\n \"error\": null,\n \"createdAt\": \"2026-01-16T00:12:43.756Z\",\n \"updatedAt\": \"2026-01-16T00:12:49.897Z\"\n }\n ],\n \"count\": 1\n}" } ] } ] }, { "name": "SIMA", "item": [ { "name": "Validate Single Product", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"sku\": \"SKU001\",\n \"name\": \"Cotton T-Shirt\",\n \"hsCode\": \"6109.10.00\",\n \"countryOfOrigin\": \"CN\",\n \"material\": \"cotton\",\n \"allMaterials\": [\"cotton\", \"polyester\"],\n \"monthlyVolume\": 1000\n}" }, "url": { "raw": "{{BASE_URL}}/api/sima/validate", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "validate" ] }, "description": "Validate single product for SIMA exposure. Only hsCode is required." } }, { "name": "Batch Validate SKUs", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"skus\": [\"SKU001\", \"SKU002\", \"SKU003\"],\n \"runPolicy\": \"always\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/sima/batch", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "batch" ] }, "description": "Batch validate SKUs (creates async job). Omit 'skus' to validate all tenant SKUs." } }, { "name": "Get Results", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/results?outcome=&workflow=&limit=100&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "results" ], "query": [ { "key": "outcome", "value": "", "description": "AT_RISK, CLEARED, FALSE_POSITIVE, NEEDS_REVIEW (comma-separated for multiple)" }, { "key": "workflow", "value": "", "description": "OPEN, OVERRIDDEN, ACCEPTED, DISMISSED" }, { "key": "limit", "value": "100" }, { "key": "offset", "value": "0" } ] }, "description": "Return SIMA outcomes (1 row per SKU) with pagination. Filter by outcome status or workflow state." } }, { "name": "Get Flagged", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/flagged?limit=100&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "flagged" ], "query": [ { "key": "limit", "value": "100" }, { "key": "offset", "value": "0" } ] }, "description": "Return AT_RISK + NEEDS_REVIEW outcomes with pagination." } }, { "name": "Get Summary", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/summary", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "summary" ] }, "description": "Get aggregate counts: totalSkus, atRisk, needsReview, totalExposure." } }, { "name": "Get SKU Evidence", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/results/:sku/evidence", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "results", ":sku", "evidence" ], "variable": [ { "key": "sku", "value": "your-sku-here", "description": "SKU identifier" } ] }, "description": "Get full evidence payload for a SKU including classification, attributes, history, and audit trail." } }, { "name": "Accept Result", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/results/:sku/accept", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "results", ":sku", "accept" ], "variable": [ { "key": "sku", "value": "your-sku-here", "description": "SKU identifier" } ] }, "description": "Accept the SIMA result. Sets workflowStatus = ACCEPTED." } }, { "name": "Dismiss Result", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/results/:sku/dismiss", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "results", ":sku", "dismiss" ], "variable": [ { "key": "sku", "value": "your-sku-here", "description": "SKU identifier" } ] }, "description": "Dismiss the SIMA result. Sets workflowStatus = DISMISSED." } }, { "name": "Reopen Result", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/results/:sku/reopen", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "results", ":sku", "reopen" ], "variable": [ { "key": "sku", "value": "your-sku-here", "description": "SKU identifier" } ] }, "description": "Reopen a previously accepted/dismissed result. Sets workflowStatus = OPEN." } }, { "name": "Override HS Code", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"hs_override\": \"9999999999\",\n \"override_reason\": \"Manual correction - product misclassified\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/sima/results/:sku/override", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "results", ":sku", "override" ], "variable": [ { "key": "sku", "value": "your-sku-here", "description": "SKU identifier" } ] }, "description": "Override the HS code for a SKU and re-evaluate SIMA exposure. Sets workflowStatus = OVERRIDDEN if cleared." } }, { "name": "Get Exposures", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/exposures?status=&measureCode=&minRisk=&limit=100&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "exposures" ], "query": [ { "key": "status", "value": "", "description": "AT_RISK, CLEARED, FALSE_POSITIVE, NEEDS_REVIEW" }, { "key": "measureCode", "value": "", "description": "Filter by SIMA measure code" }, { "key": "minRisk", "value": "", "description": "Minimum risk threshold (decimal)" }, { "key": "limit", "value": "100" }, { "key": "offset", "value": "0" } ] }, "description": "Query SIMA exposures with filtering and pagination." } }, { "name": "Export Report (JSON)", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/report?format=json&filter=&status=", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "report" ], "query": [ { "key": "format", "value": "json", "description": "json or csv" }, { "key": "filter", "value": "", "description": "all (default), flagged, covered" }, { "key": "status", "value": "", "description": "Filter by status" } ] }, "description": "Export SIMA report in JSON format. Use filter=covered to export exposures, or filter=flagged for action items." } }, { "name": "Export Report (CSV)", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/report?format=csv&filter=&status=", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "report" ], "query": [ { "key": "format", "value": "csv" }, { "key": "filter", "value": "" }, { "key": "status", "value": "" } ] }, "description": "Export SIMA report in CSV format. Use filter=covered for exposures, filter=flagged for action items." } }, { "name": "List Measures", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/measures", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "measures" ] }, "description": "List all available SIMA measures." } }, { "name": "Calculate Risk", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/sima/risk?measureCode=MA001&monthlyVolume=1000", "host": [ "{{BASE_URL}}" ], "path": [ "api", "sima", "risk" ], "query": [ { "key": "measureCode", "value": "MA001", "description": "SIMA measure code (required)" }, { "key": "monthlyVolume", "value": "1000", "description": "Monthly unit volume" } ] }, "description": "Calculate risk for a measure and volume." } } ] }, { "name": "Attributes", "item": [ { "name": "Get SKU Attributes", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/attributes/:sku", "host": [ "{{BASE_URL}}" ], "path": [ "api", "attributes", ":sku" ], "variable": [ { "key": "sku", "value": "SKU001" } ] }, "description": "Get validated attributes for a specific SKU." } }, { "name": "Validate Attributes", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"countryOfOrigin\": \"China\",\n \"material\": \"cotton\",\n \"allMaterials\": [\"cotton\", \"polyester\"],\n \"hsCode\": \"6109.10.00\",\n \"productName\": \"Cotton T-Shirt\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/attributes/validate", "host": [ "{{BASE_URL}}" ], "path": [ "api", "attributes", "validate" ] }, "description": "Validate country, material, and/or HS code. All fields are optional." } }, { "name": "Submit Correction", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"sku\": \"SKU001\",\n \"attributeName\": \"countryOfOrigin\",\n \"correctedValue\": \"US\",\n \"correctionSource\": \"manual\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/attributes/correct", "host": [ "{{BASE_URL}}" ], "path": [ "api", "attributes", "correct" ] }, "description": "Submit a manual correction for an attribute." } } ] }, { "name": "Trade", "item": [ { "name": "Classify Product", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"description\": \"Men's cotton t-shirt with printed graphics\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/trade/classify", "host": [ "{{BASE_URL}}" ], "path": [ "api", "trade", "classify" ] }, "description": "Classify a product and return HS code." } }, { "name": "Calculate Landed Cost", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"productValue\": 100.00,\n \"hsCode\": \"6109.10.00\",\n \"originCountry\": \"CN\",\n \"destinationCountry\": \"US\",\n \"shippingCost\": 50.00,\n \"insurance\": 10.00\n}" }, "url": { "raw": "{{BASE_URL}}/api/trade/landed-cost", "host": [ "{{BASE_URL}}" ], "path": [ "api", "trade", "landed-cost" ] }, "description": "Calculate landed cost breakdown. Required: productValue, hsCode, originCountry, destinationCountry." } } ] }, { "name": "Ship", "item": [ { "name": "Upload Shipments CSV", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Shipment CSV file" } ] }, "url": { "raw": "{{BASE_URL}}/api/ship/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "ship", "upload" ] }, "description": "Upload a carrier shipment CSV for SHIP audit processing. Returns a jobId for async processing." }, "response": [ { "name": "Accepted", "originalRequest": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Shipment CSV file" } ] }, "url": { "raw": "{{BASE_URL}}/api/ship/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "ship", "upload" ] }, "description": "Upload a carrier shipment CSV for SHIP audit processing. Returns a jobId for async processing." }, "status": "Accepted", "code": 202, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"jobId\": \"job-123\",\n \"fileName\": \"shipments.csv\",\n \"status\": \"pending\"\n}" } ] }, { "name": "Upload Carrier Agreement CSV", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Carrier agreement CSV file" } ] }, "url": { "raw": "{{BASE_URL}}/api/carrier/agreements/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "carrier", "agreements", "upload" ] }, "description": "Upload a carrier agreement CSV for tenant contract import. Returns a jobId for async processing." }, "response": [ { "name": "Accepted", "originalRequest": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Carrier agreement CSV file" } ] }, "url": { "raw": "{{BASE_URL}}/api/carrier/agreements/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "carrier", "agreements", "upload" ] }, "description": "Upload a carrier agreement CSV for tenant contract import. Returns a jobId for async processing." }, "status": "Accepted", "code": 202, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"jobId\": \"job-123\",\n \"fileName\": \"carrier-agreement.csv\",\n \"status\": \"PENDING\"\n}" }, { "name": "Duplicate", "originalRequest": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "", "description": "Carrier agreement CSV file" } ] }, "url": { "raw": "{{BASE_URL}}/api/carrier/agreements/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "carrier", "agreements", "upload" ] }, "description": "Upload a carrier agreement CSV for tenant contract import. Returns a jobId for async processing." }, "status": "Conflict", "code": 409, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"code\": \"DUPLICATE_UPLOAD\",\n \"message\": \"This file has already been uploaded\",\n \"details\": {\n \"existingJobId\": \"job-existing\"\n }\n}" } ] }, { "name": "List Shipments (Audit)", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/ship/audit?outcome=&workflow_status=&has_active_findings=&job_id=&limit=100&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "ship", "audit" ], "query": [ { "key": "outcome", "value": "", "description": "Filter by outcome: AT_RISK, NEEDS_REVIEW, CLEARED (comma-separated for multiple)" }, { "key": "workflow_status", "value": "", "description": "Filter by workflow status: OPEN, DISPUTED, SUBMITTED, CARRIER_REVIEW, CREDITED, REJECTED, DISMISSED" }, { "key": "has_active_findings", "value": "", "description": "Filter by active findings: true or false" }, { "key": "job_id", "value": "", "description": "Filter by upload job ID" }, { "key": "limit", "value": "100" }, { "key": "offset", "value": "0" } ] }, "description": "List shipments with rollup outcomes and findings counts. Sorted by active findings first, then ship date descending." } }, { "name": "Get Shipment Detail", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/ship/shipments/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "ship", "shipments", ":id" ], "variable": [ { "key": "id", "value": "your-shipment-id-here", "description": "Shipment UUID" } ] }, "description": "Get full shipment details including all findings and audit history." } }, { "name": "Get Summary", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/ship/summary", "host": [ "{{BASE_URL}}" ], "path": [ "api", "ship", "summary" ] }, "description": "Get SHIP module summary: totalShipments, atRisk, needsReview, cleared, totalFindings, totalVariance." } } ] }, { "name": "Search", "item": [ { "name": "Global Search", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/search?q=test&entities=shipment,finding&limit=20", "host": [ "{{BASE_URL}}" ], "path": [ "api", "search" ], "query": [ { "key": "q", "value": "test", "description": "Search query (2-120 chars). Matched against entity-specific fields (tracking number, SKU, HS code, etc.)." }, { "key": "entities", "value": "shipment,finding", "description": "Comma-separated entity types to search: shipment, finding, sima_result, job. Defaults to all." }, { "key": "limit", "value": "20", "description": "Max results per page (1-50, default 20)." }, { "key": "include_resolved", "value": "false", "description": "Include resolved/credited/dismissed findings and closed SIMA results. Default false." }, { "key": "cursor", "value": "", "description": "Opaque pagination cursor from previous response's nextCursor field." } ] }, "description": "Global search across shipments, findings, SIMA results, and jobs. Results are ranked by match quality (exact > prefix > word boundary > contains), field importance (primary > secondary), and recency. Returns paginated results with opaque cursor-based pagination.\n\nNot available for integration principals (returns 403).\n\nExample response:\n```json\n{\n \"query\": \"test\",\n \"entities\": [\"shipment\", \"finding\", \"sima_result\", \"job\"],\n \"limit\": 20,\n \"nextCursor\": null,\n \"results\": [\n {\n \"entityType\": \"shipment\",\n \"entityId\": \"uuid\",\n \"title\": \"Tracking 1Z999AA1\",\n \"subtitle\": \"UPS | 2026-02-14 | AT_RISK\",\n \"url\": \"/ship/audit?shipmentId=uuid\",\n \"status\": \"AT_RISK\",\n \"score\": 850,\n \"matchedOn\": [\"tracking_number\"],\n \"updatedAt\": \"2026-02-14T10:00:00.000Z\"\n }\n ]\n}\n```" } } ] }, { "name": "Dashboard", "item": [ { "name": "Get Action Cards", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/dashboard/actions", "host": [ "{{BASE_URL}}" ], "path": [ "api", "dashboard", "actions" ] }, "description": "Get 4 action queue cards: SHIP open findings, pending disputes, TRADE at-risk SKUs, and needs-review SKUs. Each card includes count, dollar value, and SLA label." } }, { "name": "Get Value Cards", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/dashboard/value", "host": [ "{{BASE_URL}}" ], "path": [ "api", "dashboard", "value" ] }, "description": "Get 3 value cards: SHIP recovered, SHIP avoided, and TRADE risk prevented. Each card includes 30d/90d aggregates and a daily sparkline series." } } ] }, { "name": "Reports", "item": [ { "name": "Get Report Summary", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/reports/summary?range=30d", "host": [ "{{BASE_URL}}" ], "path": [ "api", "reports", "summary" ], "query": [ { "key": "range", "value": "30d", "description": "Time range: 7d, 30d, 90d (default 30d)" } ] }, "description": "Get module-level compliance stats (SHIP and TRADE) with recent activity feed. Supports time range filtering." } }, { "name": "Export Report (CSV)", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/reports/export?module=ship&range=30d", "host": [ "{{BASE_URL}}" ], "path": [ "api", "reports", "export" ], "query": [ { "key": "module", "value": "ship", "description": "Module to export: ship or trade (required)" }, { "key": "range", "value": "30d", "description": "Time range: 7d, 30d, 90d (default 30d)" } ] }, "description": "Export findings (SHIP) or SIMA outcomes (TRADE) as CSV. Returns file download with Content-Disposition header." } } ] }, { "name": "Notifications", "item": [ { "name": "Get Notification Preferences", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/notifications/preferences", "host": [ "{{BASE_URL}}" ], "path": [ "api", "notifications", "preferences" ] }, "description": "Get notification preferences for the current tenant. Returns defaults (digestTime, timezone, emailEnabled) and per-alert-type preferences." } }, { "name": "Update Notification Preferences", "request": { "method": "PUT", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"defaults\": {\n \"digestTime\": \"09:00\",\n \"timezone\": \"America/Chicago\",\n \"emailEnabled\": true\n },\n \"alerts\": [\n {\n \"alertType\": \"trade.daily_digest\",\n \"enabled\": true,\n \"recipients\": [\"compliance@example.com\"],\n \"channels\": [\"email\"]\n }\n ]\n}" }, "url": { "raw": "{{BASE_URL}}/api/notifications/preferences", "host": [ "{{BASE_URL}}" ], "path": [ "api", "notifications", "preferences" ] }, "description": "Update notification preferences. Requires admin:notifications scope. Supports partial updates (defaults only, alerts only, or both)." } }, { "name": "Get Notification History", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/notifications/history?limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "notifications", "history" ], "query": [ { "key": "limit", "value": "50", "description": "Page size (default 50, max 200)" }, { "key": "offset", "value": "0", "description": "Offset for pagination" }, { "key": "alertType", "value": "trade.daily_digest", "description": "Filter by alert type", "disabled": true }, { "key": "status", "value": "sent", "description": "Filter by status: sent, failed, suppressed", "disabled": true }, { "key": "since", "value": "2026-01-01T00:00:00Z", "description": "Filter: sent at or after (ISO date)", "disabled": true }, { "key": "until", "value": "2026-12-31T23:59:59Z", "description": "Filter: sent at or before (ISO date)", "disabled": true } ] }, "description": "List notification history for the current tenant. Supports filtering by alertType, status, and date range." } } ] }, { "name": "Product", "item": [ { "name": "Check Alcohol Compliance", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"id\": \"order-123\",\n \"items\": [\n {\n \"sku\": \"WINE001\",\n \"quantity\": 5,\n \"alcoholContent\": 12.5\n }\n ],\n \"destinationState\": \"CA\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/product/check-alcohol", "host": [ "{{BASE_URL}}" ], "path": [ "api", "product", "check-alcohol" ] }, "description": "Check alcohol shipping compliance for an order." } } ] }, { "name": "Finance", "item": [ { "name": "Check Payment Compliance", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"id\": \"order-123\",\n \"items\": [\n {\n \"sku\": \"SKU001\",\n \"price\": 100.00,\n \"quantity\": 2\n }\n ],\n \"paymentProvider\": \"stripe\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/finance/check-payment", "host": [ "{{BASE_URL}}" ], "path": [ "api", "finance", "check-payment" ] }, "description": "Check payment compliance for an order." } } ] }, { "name": "Orders & Catalog", "item": [ { "name": "Upload Catalog", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}", "type": "text" }, { "key": "x-org-id", "value": "{{ORG_ID}}", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": [] }, { "key": "sourceAdapter", "value": "wayfair-excel", "type": "text" } ] }, "url": { "raw": "{{BASE_URL}}/api/catalog/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "catalog", "upload" ] }, "description": "Upload catalog file for asynchronous processing." } }, { "name": "Upload Orders CSV", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}", "type": "text" }, { "key": "x-org-id", "value": "{{ORG_ID}}", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": [] }, { "key": "ingestMode", "value": "PATCH", "type": "text" } ] }, "url": { "raw": "{{BASE_URL}}/api/orders/upload", "host": [ "{{BASE_URL}}" ], "path": [ "api", "orders", "upload" ] }, "description": "Upload orders CSV for asynchronous ingestion and finding linkage. Optional ingestMode: PATCH (default merge) or SNAPSHOT (overwrite)." } }, { "name": "List Orders", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}", "type": "text" }, { "key": "x-org-id", "value": "{{ORG_ID}}", "type": "text" } ], "url": { "raw": "{{BASE_URL}}/api/orders?limit=20&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "orders" ], "query": [ { "key": "limit", "value": "20" }, { "key": "offset", "value": "0" } ] }, "description": "List ingested orders with pagination." } }, { "name": "Get Order Detail", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}", "type": "text" }, { "key": "x-org-id", "value": "{{ORG_ID}}", "type": "text" } ], "url": { "raw": "{{BASE_URL}}/api/orders/{{ORDER_ID}}", "host": [ "{{BASE_URL}}" ], "path": [ "api", "orders", "{{ORDER_ID}}" ] }, "description": "Fetch a single order with line items." } } ] }, { "name": "Admin - Reference Data", "description": "Admin-only endpoints for managing reference data (trade remedies, carrier rules, data releases) with versioning, audit trail, and cache invalidation. All routes require admin access.", "item": [ { "name": "List Trade Remedies", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/ref/trade-remedies?country=&status=&caseType=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "trade-remedies" ], "query": [ { "key": "country", "value": "", "description": "Filter by country code (e.g. CA)" }, { "key": "status", "value": "", "description": "Filter by status (ACTIVE, SUSPENDED, etc.)" }, { "key": "caseType", "value": "", "description": "Filter by case type (AD, CVD, etc.)" }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "List trade remedies with pagination and optional filters." } }, { "name": "Create Trade Remedy", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"country\": \"CA\",\n \"caseNumber\": \"AD-2026-001\",\n \"caseType\": \"AD\",\n \"productScope\": \"Stainless steel sinks\",\n \"originCountries\": [\"CN\"],\n \"hsCodes\": [\"7324100010\"],\n \"dutyType\": \"ad_valorem\",\n \"dutyRate\": 0.31,\n \"effectiveFrom\": \"2024-01-01\",\n \"effectiveTo\": null,\n \"status\": \"ACTIVE\",\n \"coverageTier\": \"ALPHA\",\n \"sourceUrl\": \"https://cbsa-asfc.gc.ca/sima/example\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/ref/trade-remedies", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "trade-remedies" ] }, "description": "Create a new trade remedy. Required fields: country, caseNumber, caseType. Logs change to audit trail and invalidates cache." } }, { "name": "Get Trade Remedy Detail", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/ref/trade-remedies/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "trade-remedies", ":id" ], "variable": [ { "key": "id", "value": "your-trade-remedy-cuid-here", "description": "Trade remedy CUID" } ] }, "description": "Get trade remedy detail by CUID." } }, { "name": "Update Trade Remedy", "request": { "method": "PUT", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"status\": \"SUSPENDED\",\n \"version\": 1\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/ref/trade-remedies/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "trade-remedies", ":id" ], "variable": [ { "key": "id", "value": "your-trade-remedy-cuid-here", "description": "Trade remedy CUID" } ] }, "description": "Update a trade remedy with optimistic concurrency. Include the current version number in the body. Returns 409 on version conflict." } }, { "name": "List Carrier Rules", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/ref/carrier-rules?carrier=&ruleType=&status=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "carrier-rules" ], "query": [ { "key": "carrier", "value": "", "description": "Filter by carrier (e.g. UPS, FedEx)" }, { "key": "ruleType", "value": "", "description": "Filter by rule type (e.g. CLAIM_WINDOW)" }, { "key": "status", "value": "", "description": "Filter by status (ACTIVE, etc.)" }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "List carrier rules with pagination and optional filters." } }, { "name": "Create Carrier Rule", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"carrier\": \"UPS\",\n \"ruleType\": \"CLAIM_WINDOW\",\n \"ruleKey\": \"filing_window_days\",\n \"ruleValue\": {\"filingWindowDays\": 15},\n \"effectiveFrom\": \"2024-01-01\",\n \"effectiveTo\": null,\n \"status\": \"ACTIVE\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/ref/carrier-rules", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "carrier-rules" ] }, "description": "Create a new carrier rule. Required fields: carrier, ruleType, ruleKey, ruleValue. Logs change to audit trail." } }, { "name": "Get Carrier Rule Detail", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/ref/carrier-rules/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "carrier-rules", ":id" ], "variable": [ { "key": "id", "value": "your-carrier-rule-cuid-here", "description": "Carrier rule CUID" } ] }, "description": "Get carrier rule detail by CUID." } }, { "name": "Update Carrier Rule", "request": { "method": "PUT", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"ruleValue\": {\"filingWindowDays\": 20},\n \"version\": 1\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/ref/carrier-rules/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "carrier-rules", ":id" ], "variable": [ { "key": "id", "value": "your-carrier-rule-cuid-here", "description": "Carrier rule CUID" } ] }, "description": "Update a carrier rule with optimistic concurrency. Include the current version number in the body. Returns 409 on version conflict." } }, { "name": "List Data Releases", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/ref/data-releases?sourceId=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "data-releases" ], "query": [ { "key": "sourceId", "value": "", "description": "Filter by data source ID" }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "List data releases with pagination. Optionally filter by sourceId." } }, { "name": "Create Data Release", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"sourceId\": \"your-data-source-cuid\",\n \"version\": \"CA-2026.02\",\n \"releasedAt\": \"2026-02-01\",\n \"checksum\": \"sha256:abc123\",\n \"notes\": \"February 2026 CBSA update\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/ref/data-releases", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "data-releases" ] }, "description": "Create a new data release. Required fields: sourceId, version, releasedAt. appliedAt is auto-set by schema default." } }, { "name": "Get Change Log", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/ref/change-log?tableName=&recordId=&changeType=&changedBy=&startDate=&endDate=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "ref", "change-log" ], "query": [ { "key": "tableName", "value": "", "description": "Filter by table (e.g. trade_remedies, carrier_rules)" }, { "key": "recordId", "value": "", "description": "Filter by record ID" }, { "key": "changeType", "value": "", "description": "Filter by change type (CREATE, UPDATE)" }, { "key": "changedBy", "value": "", "description": "Filter by user/system identifier" }, { "key": "startDate", "value": "", "description": "Filter changes on or after this date (ISO 8601)" }, { "key": "endDate", "value": "", "description": "Filter changes on or before this date (ISO 8601)" }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "Query the audit trail for reference data changes. Supports filtering by table, record, change type, user, and date range." } } ] }, { "name": "Admin - Tenant Onboarding", "description": "Admin endpoints for tenant lifecycle: create, update, configure detectors, issue integration keys, and check onboarding progress. See specs/p6-f-onboarding-api-contract.md for full contract.", "item": [ { "name": "List Tenants", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/tenants?limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants" ], "query": [ { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" }, { "key": "status", "value": "active", "disabled": true }, { "key": "search", "value": "", "disabled": true } ] }, "description": "List tenants with pagination, optional status filter, and search by name/slug." } }, { "name": "Create Tenant", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"Acme Corp\",\n \"slug\": \"acme-corp\",\n \"modules\": [\"ship\"],\n \"primaryContact\": {\n \"email\": \"ops@acme.com\",\n \"role\": \"org:admin\"\n }\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/tenants", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants" ] }, "description": "Create tenant with module selection and optional Clerk org invite. Returns 201 with tenant + inviteStatus. 409 if slug/clerkOrgId already exists." } }, { "name": "Get Tenant Detail", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/tenants/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants", ":id" ], "variable": [ { "key": "id", "value": "your-tenant-uuid-here", "description": "Tenant UUID" } ] }, "description": "Get tenant detail with modules and _counts (integrationKeys, detectorConfigs, jobs). 404 if not found." } }, { "name": "Update Tenant", "request": { "method": "PUT", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"Acme Corp (Renamed)\",\n \"status\": \"suspended\",\n \"modules\": [\"ship\", \"trade\"]\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/tenants/:id", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants", ":id" ], "variable": [ { "key": "id", "value": "your-tenant-uuid-here", "description": "Tenant UUID" } ] }, "description": "Update tenant fields (name, slug, status, modules, clerkOrgId). All fields optional. 404 if not found, 409 if slug/clerkOrgId conflicts." } }, { "name": "Create Integration Key (Admin)", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"Production CLI\",\n \"scopes\": [\"ship:upload\", \"ship:read\", \"jobs:read\"],\n \"allowedAdapters\": [\"generic-shipment-csv\"],\n \"defaultAdapter\": \"generic-shipment-csv\",\n \"expiresAt\": null\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/tenants/:id/integration-keys", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants", ":id", "integration-keys" ], "variable": [ { "key": "id", "value": "your-tenant-uuid-here", "description": "Tenant UUID" } ] }, "description": "Create integration key for tenant. Secret returned once in response — save it immediately. 404 if tenant not found." } }, { "name": "Configure Detectors", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"detectors\": [\n { \"detectorCode\": \"AMOUNT_VARIANCE\", \"enabled\": true, \"config\": { \"thresholdPercent\": 5 } },\n { \"detectorCode\": \"SIMA_EXPOSURE\", \"enabled\": false, \"config\": null }\n ]\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/tenants/:id/detectors", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants", ":id", "detectors" ], "variable": [ { "key": "id", "value": "your-tenant-uuid-here", "description": "Tenant UUID" } ] }, "description": "Bulk upsert detector configs. Live codes: AMOUNT_VARIANCE (SHIP), SIMA_EXPOSURE (TRADE). 400 if unknown detector codes." } }, { "name": "Get Onboarding Status", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/tenants/:id/onboarding-status", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "tenants", ":id", "onboarding-status" ], "variable": [ { "key": "id", "value": "your-tenant-uuid-here", "description": "Tenant UUID" } ] }, "description": "Derived onboarding checklist. Steps: tenant_created, integration_key_issued, detectors_configured, carrier_accounts_linked, first_upload_completed, pilot_validated. Returns progress and nextStep." } } ] }, { "name": "Admin - Billing", "description": "Admin endpoints for gain-share invoice lifecycle. All routes are cross-tenant and require tenantId explicitly (query param for GET, body for POST) because billing tables have FORCE ROW LEVEL SECURITY.", "item": [ { "name": "List Invoices", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/billing/invoices?tenantId={{tenantId}}&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "billing", "invoices" ], "query": [ { "key": "tenantId", "value": "{{tenantId}}", "description": "Required. Tenant UUID — sets RLS context for FORCE RLS tables." }, { "key": "status", "value": "DRAFT", "description": "Filter by status: DRAFT, ISSUED, PAID, CANCELLED", "disabled": true }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "List invoices for a tenant with pagination and optional status filter. Returns { items, total, limit, offset, hasMore }." } }, { "name": "Generate Draft Invoice", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"tenantId\": \"{{tenantId}}\",\n \"periodStart\": \"2026-01-01\",\n \"periodEnd\": \"2026-01-31\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/billing/invoices/generate", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "billing", "invoices", "generate" ] }, "description": "Generate a draft invoice for a tenant and billing period. Returns 201 with the draft invoice. 422 if no billable events exist in the period." } }, { "name": "Get Invoice Detail", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/admin/billing/invoices/:id?tenantId={{tenantId}}", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "billing", "invoices", ":id" ], "query": [ { "key": "tenantId", "value": "{{tenantId}}", "description": "Required. Tenant UUID — sets RLS context for FORCE RLS tables." } ], "variable": [ { "key": "id", "value": "your-invoice-uuid-here", "description": "Invoice UUID" } ] }, "description": "Get invoice detail with linked value event count. Returns invoice fields plus linkedEventCount. 404 if not found." } }, { "name": "Issue Invoice", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"tenantId\": \"{{tenantId}}\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/billing/invoices/:id/issue", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "billing", "invoices", ":id", "issue" ], "variable": [ { "key": "id", "value": "your-invoice-uuid-here", "description": "Invoice UUID" } ] }, "description": "Issue a draft invoice (DRAFT → ISSUED), claiming linked value events. Requires tenantId in body for RLS context. 404 if not found, 409 if invoice is not in DRAFT status." } }, { "name": "Mark Invoice Paid", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"tenantId\": \"{{tenantId}}\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/billing/invoices/:id/mark-paid", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "billing", "invoices", ":id", "mark-paid" ], "variable": [ { "key": "id", "value": "your-invoice-uuid-here", "description": "Invoice UUID" } ] }, "description": "Mark an issued invoice as paid (ISSUED → PAID). Requires tenantId in body for RLS context. 404 if not found, 409 if invoice is not in ISSUED status." } }, { "name": "Cancel Invoice", "request": { "method": "POST", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"tenantId\": \"{{tenantId}}\"\n}" }, "url": { "raw": "{{BASE_URL}}/api/admin/billing/invoices/:id/cancel", "host": [ "{{BASE_URL}}" ], "path": [ "api", "admin", "billing", "invoices", ":id", "cancel" ], "variable": [ { "key": "id", "value": "your-invoice-uuid-here", "description": "Invoice UUID" } ] }, "description": "Cancel a draft or issued invoice (DRAFT/ISSUED → CANCELLED). If issued, unclaims linked value events. Requires tenantId in body for RLS context. 404 if not found, 409 if invoice is already PAID or CANCELLED." } } ] }, { "name": "Notifications (P2A-B Planned)", "description": "PLANNED (P2A-B) - Notification system endpoints for email alerts, spike detection, and delivery preferences. These endpoints are spec'd but not yet implemented.", "item": [ { "name": "Get Notification Preferences", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/notifications/preferences", "host": [ "{{BASE_URL}}" ], "path": [ "api", "notifications", "preferences" ] }, "description": "PLANNED (P2A-B) - Get current tenant notification preferences. Returns alert types with enabled/disabled status, recipient lists, and per-alert config (thresholds, times, timezones).\n\nExample response:\n```json\n{\n \"tenantId\": \"uuid\",\n \"defaults\": {\n \"digestTime\": \"08:00\",\n \"timezone\": \"America/New_York\",\n \"emailEnabled\": true\n },\n \"alerts\": [\n {\n \"alertType\": \"trade.daily_digest\",\n \"enabled\": true,\n \"recipients\": [\"user-uuid-1\"],\n \"channels\": [\"email\"],\n \"config\": {\n \"digestTime\": \"08:00\",\n \"timezone\": \"America/New_York\"\n }\n }\n ],\n \"updatedAt\": \"2026-02-12T10:00:00Z\"\n}\n```" } }, { "name": "Update Notification Preferences", "request": { "method": "PUT", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"defaults\": {\n \"digestTime\": \"09:00\",\n \"timezone\": \"America/Chicago\"\n },\n \"alerts\": [\n {\n \"alertType\": \"trade.daily_digest\",\n \"enabled\": true,\n \"recipients\": [\"user-uuid-1\", \"user-uuid-3\"],\n \"config\": {\n \"digestTime\": \"09:00\",\n \"timezone\": \"America/Chicago\"\n }\n },\n {\n \"alertType\": \"trade.spike_detection\",\n \"enabled\": false\n },\n {\n \"alertType\": \"ship.exception_alert\",\n \"enabled\": true,\n \"recipients\": [\"user-uuid-1\"],\n \"config\": {\n \"varianceThresholdPct\": 25\n }\n }\n ]\n}" }, "url": { "raw": "{{BASE_URL}}/api/notifications/preferences", "host": [ "{{BASE_URL}}" ], "path": [ "api", "notifications", "preferences" ] }, "description": "PLANNED (P2A-B) - Update notification preferences for the current tenant. Partial updates: only provided alert types are modified; omitted ones keep current settings.\n\nValid alert types: trade.daily_digest, trade.spike_detection, trade.caught_order, ship.monthly_reconciliation, ship.exception_alert, ship.stale_dispute_reminder.\n\nExample response:\n```json\n{\n \"tenantId\": \"uuid\",\n \"updated\": 3,\n \"alerts\": [...],\n \"updatedAt\": \"2026-02-12T11:00:00Z\"\n}\n```" } }, { "name": "Get Notification History", "request": { "method": "GET", "header": [ { "key": "x-api-key", "value": "{{API_KEY}}" }, { "key": "x-org-id", "value": "{{ORG_ID}}" } ], "url": { "raw": "{{BASE_URL}}/api/notifications/history?alertType=&status=&since=&until=&limit=50&offset=0", "host": [ "{{BASE_URL}}" ], "path": [ "api", "notifications", "history" ], "query": [ { "key": "alertType", "value": "", "description": "Filter by alert type (e.g. trade.daily_digest, ship.exception_alert)" }, { "key": "status", "value": "", "description": "Filter by delivery status: sent, failed, suppressed" }, { "key": "since", "value": "", "description": "Start date for history window (ISO 8601). Defaults to 30 days ago." }, { "key": "until", "value": "", "description": "End date for history window (ISO 8601). Defaults to now." }, { "key": "limit", "value": "50" }, { "key": "offset", "value": "0" } ] }, "description": "PLANNED (P2A-B) - Paginated list of sent notifications for the current tenant. Used for debugging delivery issues and verifying alert content.\n\nExample response:\n```json\n{\n \"items\": [\n {\n \"id\": \"uuid\",\n \"alertType\": \"trade.daily_digest\",\n \"status\": \"sent\",\n \"recipientCount\": 2,\n \"subject\": \"RGL8R Daily TRADE Digest - 12 AT_RISK SKUs ($43,200 exposure)\",\n \"idempotencyKey\": \"tenant-uuid:trade.daily_digest:2026-02-12\",\n \"sentAt\": \"2026-02-12T08:00:00Z\",\n \"metadata\": {\n \"skuCount\": 12,\n \"totalExposure\": 43200\n }\n }\n ],\n \"total\": 87,\n \"limit\": 50,\n \"offset\": 0,\n \"hasMore\": true\n}\n```" } } ] } ] }