资源

类别

类别 的每一个端点,附带它强制要求的作用域、它接受的请求体、一份可读的响应,以及它可能返回的拒绝。

列出产品类别。

get/categories
作用域
无需作用域
Idempotency-Key
不接受
返回
200
请求
curl "https://passportcraft.com/api/v1/categories" \
  -H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"
响应 · 200
{
  "object": "list",
  "data": [
    {
      "object": "category",
      "id": "general",
      "name": "categories/general",
      "display_name": "General Product",
      "schema_version": "1.0.0-draft",
      "field_count": 28
    },
    {
      "object": "category",
      "id": "textile",
      "name": "categories/textile",
      "display_name": "Textile / Apparel",
      "schema_version": "1.0.0-draft",
      "field_count": 51
    },
    {
      "object": "category",
      "id": "battery",
      "name": "categories/battery",
      "display_name": "Battery",
      "schema_version": "1.0.0-draft",
      "field_count": 92
    }
  ],
  "has_more": false,
  "next_cursor": null
}

GET /categories

获取某个类别的字段架构。

get/categories/{category}/schema
作用域
无需作用域
Idempotency-Key
不接受
返回
200

路径参数

categorystring必填

类别 ID,取值与类别列表所返回的一致。

错误

该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。

请求
curl "https://passportcraft.com/api/v1/categories/textile/schema" \
  -H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"
响应 · 200
{
  "object": "category_schema",
  "id": "textile",
  "name": "categories/textile/schema",
  "category": "textile",
  "display_name": "Textile / Apparel",
  "schema_version": "1.0.0-draft",
  "field_groups": [
    {
      "object": "field_group",
      "id": "identification",
      "label": "Product Identification",
      "description": "Core identifiers and descriptors for the product"
    },
    {
      "object": "field_group",
      "id": "manufacturer",
      "label": "Manufacturer / Economic Operator",
      "description": "Details of the manufacturer or EU responsible person"
    },
    {
      "object": "field_group",
      "id": "sustainability",
      "label": "Environmental Data",
      "description": "Carbon footprint and material recycling data"
    },
    {
      "object": "field_group",
      "id": "compliance",
      "label": "Regulatory Compliance",
      "description": "Substances of concern and conformity declarations"
    },
    {
      "object": "field_group",
      "id": "end_of_life",
      "label": "End of Life",
      "description": "Recycling and disposal guidance for the product"
    },
    {
      "object": "field_group",
      "id": "circular_economy",
      "label": "Circular Economy",
      "description": "Recyclability, disassembly, and end-of-life information"
    },
    {
      "object": "field_group",
      "id": "materials",
      "label": "Material Composition",
      "description": "Fiber content and testing methodology for textile materials"
    },
    {
      "object": "field_group",
      "id": "care",
      "label": "Care Instructions",
      "description": "ISO 3758 care symbols and human-readable care guidance"
    },
    {
      "object": "field_group",
      "id": "manufacturing",
      "label": "Manufacturing Details",
      "description": "Country of manufacture, production date, and batch traceability"
    },
    {
      "object": "field_group",
      "id": "durability",
      "label": "Durability & Repairability",
      "description": "Lifetime estimates, repairability score, and repair resources"
    }
  ],
  "fields": [
    {
      "object": "field",
      "name": "product_name",
      "type": "text",
      "required": true,
      "access_tier": "public",
      "group": "identification",
      "label": "Product Name",
      "description": "Commercial name of the product",
      "hint": "Shown as the headline on the public passport and in search.",
      "requirement": "required",
      "functional_basis": "Record identity — the passport cannot identify its product without a name.",
      "regulatory_basis": [
        {
          "regulation": "ESPR (Reg (EU) 2024/1781)",
          "reference": "Annex III(a)",
          "status": "anticipated",
          "note": "Product identifier/name — DA-gated for textiles."
        }
      ]
    },
    {
      "object": "field",
      "name": "recyclable_content_percentage",
      "type": "number",
      "required": false,
      "access_tier": "public",
      "group": "sustainability",
      "label": "Recyclable Content (%)",
      "description": "Percentage of the product that is recyclable at end of life",
      "min": 0,
      "max": 100
    },
    {
      "object": "field",
      "name": "conformity_declaration_url",
      "type": "url",
      "required": false,
      "access_tier": "authority",
      "group": "compliance",
      "label": "Declaration of Conformity URL",
      "description": "Link to the EU Declaration of Conformity document, or upload the PDF.",
      "document_types": [
        "conformity_declaration"
      ],
      "document_id_key": "conformity_declaration_url__document_id"
    }
  ]
}

GET /categories/textile/schema

类别 — PassportCraft API 参考 | PassportCraft