TracePass
Passports

Batch-create passports

Create up to 100 passports in one call. Each item carries the same body shape as the single-create endpoint (`{ productId, gs1: { gtin, serialNumber }, parties?, confirmOverage? }`). Partial-success per item — each gets its own status in the response array.

POST/api/v1/passports/batch
Download OpenAPI 3.1
POST/api/v1/passports/batch

Batch-create passports

Create up to 100 passports in one call. Each item carries the same body shape as the single-create endpoint (`{ productId, gs1: { gtin, serialNumber }, parties?, confirmOverage? }`). Partial-success per item — each gets its own status in the response array.

The whole batch consumes N writes upfront against your daily-write budget; if that would overflow, the entire batch returns 429 (no partial billing). The same applies to the DPP overage flow at the batch level — when the DPP quota would be exceeded, the batch returns 402 with `overage_required` and `confirmOverage: true` accepts the overage charge for the whole batch.

Idempotency-Key applies to the whole batch — replaying the same key returns the original full result array. Cap is 100 items per call (matches Stripe's batch ceiling so partial-success responses stay manageable).

Headers

  • Authorizationrequired

    string

    `Bearer <api-key>`.

  • Idempotency-Key

    string

    UUID v4 — applies to the whole batch.

Body fields

  • passportsrequired

    Array<CreatePassportInput> (1-100)

    1–100 passport objects, each in the single-create body shape.

Request

curl -sS -X POST https://app.tracepass.eu/api/v1/passports/batch \
  -H "Authorization: Bearer tp_REDACTED_xxxxxxxxxxxx" \
  -H "Idempotency-Key: 7b4f1e2c-9a3d-4e5b-8c1a-2d3e4f5a6b7c" \
  -H "Content-Type: application/json" \
  -d '{
    "passports": [
      { "productId": "6650a1b2c3d4e5f6a7b8c9d0", "gs1": { "gtin": "04012345000015", "serialNumber": "BP-48V-100-000001" } },
      { "productId": "6650a1b2c3d4e5f6a7b8c9d0", "gs1": { "gtin": "04012345000015", "serialNumber": "BP-48V-100-000002" } },
      { "productId": "6650a1b2c3d4e5f6a7b8c9d0", "gs1": { "gtin": "04012345000015", "serialNumber": "BP-48V-100-000003" } }
    ]
  }'

Response

{
  "results": [
    { "index": 0, "status": "created", "data": { "_id": "...", "gs1": { "...": "..." }, "status": "draft" } },
    { "index": 1, "status": "error", "error": "Serial number already exists for this GTIN" },
    { "index": 2, "status": "created", "data": { "...": "..." } }
  ],
  "summary": { "created": 2, "errors": 1, "total": 3 }
}