Skip to content

Resources

Units

Every Units endpoint, with the scope it enforces, the body it takes, a response you can read, and the refusals it can return.

List serialized units.

get/organizations/{organization}/passports/{id}/units
Scope
units:read
Idempotency-Key
Not accepted
Returns
200

Path parameters

organizationstringRequired

The organization this request acts for. The credential must hold a grant for it.

idstringRequired

The identifier of the resource. Treat it as an opaque string.

Query parameters

limitstringOptional

How many records to return. The server may return fewer.

cursorstringOptional

The next_cursor from the previous page. A cursor encodes the filters it was issued under; sending it with different filters is refused with cursor_invalid.

statusstringOptional

Return only units in this status.

unit_serialstringOptional

Return the single unit carrying this serial.

Errors

Every refusal this endpoint can return, with the status it arrives with.

Request
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units?limit=25" \
  -H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"
Response · 200
{
  "object": "list",
  "data": [
    {
      "object": "unit",
      "id": "d41d8cd9-8f00-4b20-a204-9800998ecf84",
      "name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units/d41d8cd9-8f00-4b20-a204-9800998ecf84",
      "organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
      "passport_id": "b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04",
      "passport": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04",
      "unit_serial": "BAT-2026-000117",
      "status": "original",
      "qr_target": "https://passportcraft.com/01/02000000000053/21/BAT-2026-000117",
      "livemode": true,
      "created_at": "2026-08-01T12:00:03.114Z",
      "values": {
        "status": {
          "value": "original",
          "source": "brand_statement",
          "observed_on": "2026-08-02",
          "reading_id": "a1100000-0000-4000-8000-000000000001",
          "unit_added_on": null
        }
      },
      "missing_fields": []
    }
  ],
  "has_more": false,
  "next_cursor": null
}

GET /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units?limit=25

Create serialized units.

post/organizations/{organization}/passports/{id}/units
Scope
units:write
Idempotency-Key
Accepted
Returns
201

Path parameters

organizationstringRequired

The organization this request acts for. The credential must hold a grant for it.

idstringRequired

The identifier of the resource. Treat it as an opaque string.

Request body

unitsarray of objectsRequired

Between 1 and 1000 units. The parent passport must be in the battery category — serialized units are a battery concept, and any other parent is refused with invalid_request. A serial repeated inside one request is refused per row rather than deduplicated, so a bulk importer never believes it created a row it did not.

unit_serialstringRequired

The serial carried by this physical item: 1 to 20 characters from letters, digits and ! " % & ' ( ) * + , - . / : ; < = > ? _ (GS1 Application Identifier 21). Unique within the passport.

statusstringOptional

Optional battery status: original, repurposed, re-used, remanufactured or waste. Omit it to create a battery without a status. Other values are refused for every credential.

Errors

Every refusal this endpoint can return, with the status it arrives with.

Request
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units" \
  -X POST \
  -H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "units": [
    {
      "unit_serial": "BAT-2026-000117",
      "status": "original"
    },
    {
      "unit_serial": "BAT-2026-000118"
    }
  ]
}'
Response · 201
{
  "object": "list",
  "data": [
    {
      "object": "unit",
      "id": "d41d8cd9-8f00-4b20-a204-9800998ecf84",
      "name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units/d41d8cd9-8f00-4b20-a204-9800998ecf84",
      "organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
      "passport_id": "b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04",
      "passport": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04",
      "unit_serial": "BAT-2026-000117",
      "status": "original",
      "qr_target": "https://passportcraft.com/01/02000000000053/21/BAT-2026-000117",
      "livemode": true,
      "created_at": "2026-08-02T09:31:18.446Z",
      "values": {
        "status": {
          "value": "original",
          "source": "brand_statement",
          "observed_on": "2026-08-02",
          "reading_id": "a1100000-0000-4000-8000-000000000001",
          "unit_added_on": null
        }
      },
      "missing_fields": []
    },
    {
      "object": "unit",
      "id": "5a3e7c19-2b60-4d84-91f2-7e0c4b6a8d35",
      "name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units/5a3e7c19-2b60-4d84-91f2-7e0c4b6a8d35",
      "organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
      "passport_id": "b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04",
      "passport": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04",
      "unit_serial": "BAT-2026-000118",
      "status": null,
      "qr_target": "https://passportcraft.com/01/02000000000053/21/BAT-2026-000118",
      "livemode": true,
      "created_at": "2026-08-02T09:31:18.446Z",
      "values": {},
      "missing_fields": []
    }
  ],
  "has_more": false,
  "next_cursor": null
}

POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/b6f0d4a2-71c3-4e58-8a19-3f7c2d5e8b04/units