Project promo dashboard overview

Dashboard aggregates: counts by status, by supplier, recent completed incoming documents.

Dashboard aggregates: counts by status, by supplier, recent completed incoming documents.

Why this method exists

Dashboard aggregates: counts by status, by supplier, recent completed incoming documents.

When to use

Call when opening Promo codes section or for monitoring widgets.

Typical workflow

  1. Ensure active project is selected.
  2. Pass projectId.
  3. Render aggregates from response.

Endpoint

POST /v1/internal/dashboard/overview

Authentication: JWT via Authorization: Bearer <token>. User must have project access and inventory_promo_codes permission.

Permission: inventory_promo_codes.view

Request example

{
  "meta": { "requestId": "optional-uuid" },
  "data": { "projectId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
}

Response example

{
  "success": true,
  "data": {
    "projectId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "totalCount": 211350,
    "byStatus": {
      "available": 125000,
      "realized": 45000,
      "redeemed": 38000,
      "expired": 2100,
      "revoked": 250
    },
    "bySupplier": [
      {
        "supplierId": "c219ef09-ae2f-4d08-af11-7cd51006fae4",
        "supplierName": "Промомед",
        "totalCount": 150000,
        "availableCount": 90000
      }
    ],
    "recentIncoming": [
      {
        "incomingId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "supplierName": "Промомед",
        "status": "completed",
        "insertedAvailable": 1480,
        "completedAt": "2026-07-13T09:20:00Z"
      }
    ],
    "asOf": "2026-07-13T12:00:00Z"
  },
  "meta": { "requestId": "…", "serverTime": "2026-07-13T12:00:01Z" }
}

Errors

  • UNAUTHORIZED / ACCESS_DENIED — access denied
  • VALIDATION_ERROR — invalid body
  • NOT_FOUND — resource not found
  • RATE_LIMIT_EXCEEDED (429) — rate limit

cURL

curl -X POST "https://api-external.promanta.ru/v1/internal/dashboard/overview" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT" \
  -d '{"data": { "projectId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }}'

See also

wiki.ratingPrompt

0 (0 оценок)