Skip to main content

Aggregations

What is packed in a case or pallet, identified by its SSCC.

Declare an SSCC's contents

POST https://api.dawatrack.com/partner-api/v1/aggregations/

Declare which units, or nested cases, are packed under one SSCC.

Scope events:write Manufacturers only Production credentials only Limit 5,000 per day

A child unit's gtin with a wrong GS1 check digit is 400.

Every child unit must already have a COMMISSION event. You may pack it only if you are its product's registered manufacturer, or that manufacturer authorized you as a contract packer.

A child of type SSCC must itself already be declared, by you, by a brand owner that authorized you, or by a facility you're linked to.

DawaTrack records and forwards what you declare. It doesn't verify the physical contents.

An SSCC is declared once: declaring it again is 409.

When the units are all of one product, or the child SSCCs each hold one product's units, the count is checked against the packaging hierarchy declared for it. A different count is never refused, since the last case of a batch is often part-full: the response carries a warnings list instead.

Request body

JSON. Send Content-Type: application/json.

  • sscc string Required

    18-digit GS1 AI (00) Serial Shipping Container Code.

  • children array of objects Required

    Children (SSCC or SGTIN) packed under this SSCC.

    • type enum Optional
      Possible values: SSCCSGTIN

      Default: SGTIN

    • sscc string Optional

      An 18-digit GS1 Serial Shipping Container Code.

    • gtin string Optional

      The product's GS1 GTIN, as 14 digits.

    • serial string Optional

      The unit's serial number.

Example request

curl -X POST https://api.dawatrack.com/partner-api/v1/aggregations/ \
  -H "Authorization: Bearer $DAWATRACK_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "sscc": "106164004000007317",
    "children": [
      {
        "type": "SGTIN",
        "gtin": "06164004321562",
        "serial": "SN-0007731"
      },
      {
        "type": "SGTIN",
        "gtin": "06164004321562",
        "serial": "SN-0007732"
      }
    ]
  }'
import uuid
import requests

token = "..."  # from POST /oauth/token/
response = requests.post(
    "https://api.dawatrack.com/partner-api/v1/aggregations/",
    headers={"Authorization": f"Bearer {token}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "sscc": "106164004000007317",
      "children": [
        {
          "type": "SGTIN",
          "gtin": "06164004321562",
          "serial": "SN-0007731"
        },
        {
          "type": "SGTIN",
          "gtin": "06164004321562",
          "serial": "SN-0007732"
        }
      ]
    },
)
response.raise_for_status()
print(response.json())
const token = "..."; // from POST /oauth/token/
const response = await fetch("https://api.dawatrack.com/partner-api/v1/aggregations/", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${token}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sscc": "106164004000007317",
    "children": [
      {
        "type": "SGTIN",
        "gtin": "06164004321562",
        "serial": "SN-0007731"
      },
      {
        "type": "SGTIN",
        "gtin": "06164004321562",
        "serial": "SN-0007732"
      }
    ]
  }),
});
console.log(await response.json());

Response fields

  • sscc string

    An 18-digit GS1 Serial Shipping Container Code.

  • children array of objects

    The facilities it passed the batch on to, in the same shape.

  • occurred_at datetime

    When the event happened.

  • created_at datetime

    When the record was created.

Example response

JSON
{
  "sscc": "106164004000007317",
  "children": [
    {}
  ],
  "occurred_at": "2026-10-10T09:00:00Z",
  "created_at": "2026-10-10T09:00:00Z"
}

Status codes

201Created
400The request is invalid, for example a malformed GTIN or a missing field
401No valid access token
403Your credential lacks the scope, partner type or environment this needs
404Not found, or not visible to your credential
409Conflict: a request with this Idempotency-Key is in progress, or the record already exists
429Rate limit exceeded

Fetch an SSCC's contents

GET https://api.dawatrack.com/partner-api/v1/aggregations/{sscc}/

What was declared packed under an SSCC.

Scope batches:read Limit 5,000 per day Limit 500 per day

Not limited to the partner that declared it, so a distributor or pharmacy can read what the manufacturer packed.

Path parameters

  • sscc string Required

Example request

curl -X GET https://api.dawatrack.com/partner-api/v1/aggregations/106164004000007317/ \
  -H "Authorization: Bearer $DAWATRACK_TOKEN"
import requests

token = "..."  # from POST /oauth/token/
response = requests.get(
    "https://api.dawatrack.com/partner-api/v1/aggregations/106164004000007317/",
    headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
print(response.json())
const token = "..."; // from POST /oauth/token/
const response = await fetch("https://api.dawatrack.com/partner-api/v1/aggregations/106164004000007317/", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${token}`,
  },
});
console.log(await response.json());

Response fields

  • sscc string

    An 18-digit GS1 Serial Shipping Container Code.

  • children array of objects

    The facilities it passed the batch on to, in the same shape.

  • occurred_at datetime

    When the event happened.

  • created_at datetime

    When the record was created.

Example response

JSON
{
  "sscc": "106164004000007317",
  "children": [
    {}
  ],
  "occurred_at": "2026-10-10T09:00:00Z",
  "created_at": "2026-10-10T09:00:00Z"
}

Status codes

200OK
400The request is invalid, for example a malformed GTIN or a missing field
401No valid access token
403Your credential lacks the scope, partner type or environment this needs
404Not found, or not visible to your credential
429Rate limit exceeded

Unpack an SSCC

POST https://api.dawatrack.com/partner-api/v1/aggregations/{sscc}/disaggregate/

Record that a case or pallet was opened, releasing its units and nested cases.

Scope events:write Production credentials only Limit 5,000 per day

Only the partner that declared the SSCC, or one linked to the facility holding it, can unpack it. Any other SSCC, including one never declared, returns 404.

The whole container is unpacked: every unit and nested case in it is released, and the response lists them. The body is optional: a reason, and occurred_at (default now). An SSCC already unpacked is 409.

Path parameters

  • sscc string Required

Request body

JSON. Send Content-Type: application/json.

  • reason string Optional

    Why it was opened.

  • occurred_at datetime Optional

    When; defaults to now.

Example request

curl -X POST https://api.dawatrack.com/partner-api/v1/aggregations/106164004000007317/disaggregate/ \
  -H "Authorization: Bearer $DAWATRACK_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
import uuid
import requests

token = "..."  # from POST /oauth/token/
response = requests.post(
    "https://api.dawatrack.com/partner-api/v1/aggregations/106164004000007317/disaggregate/",
    headers={"Authorization": f"Bearer {token}", "Idempotency-Key": str(uuid.uuid4())},
)
response.raise_for_status()
print(response.json())
const token = "..."; // from POST /oauth/token/
const response = await fetch("https://api.dawatrack.com/partner-api/v1/aggregations/106164004000007317/disaggregate/", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${token}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
console.log(await response.json());

Response fields

  • sscc string

    An 18-digit GS1 Serial Shipping Container Code.

  • status string

    Default: DISAGGREGATED

  • unpacked_at datetime
  • released_children array of objects

Example response

JSON
{
  "sscc": "106164004000007317",
  "status": "OPEN",
  "unpacked_at": "2026-10-10T09:00:00Z",
  "released_children": [
    {}
  ]
}

Status codes

200OK
400The request is invalid, for example a malformed GTIN or a missing field
401No valid access token
403Your credential lacks the scope, partner type or environment this needs
404Not found, or not visible to your credential
409Conflict: a request with this Idempotency-Key is in progress, or the record already exists
429Rate limit exceeded

Partner API v1. The API reference is generated from the API's own code.