资源
护照
护照 的每一个端点,附带它强制要求的作用域、它接受的请求体、一份可读的响应,以及它可能返回的拒绝。
列出护照。
/organizations/{organization}/passports- 作用域
- passports:read
Idempotency-Key- 不接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
查询参数
limitstring可选返回多少条记录。服务端返回的条数可能更少。
cursorstring可选上一页返回的 next_cursor。游标会编码签发时所用的筛选条件,改用其他筛选条件发送会被 cursor_invalid 拒绝。
statusstring可选仅返回处于该状态的护照。
categorystring可选仅返回该类别下的护照。
updated_sincestring可选一个 RFC 3339 时间戳。返回在该时刻或之后更新过的护照,集成方据此轮询变更,而不必重新读取整份目录。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports?status=published&limit=25" \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"{
"object": "list",
"data": [
{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "published",
"gtin": "03453120000011",
"external_id": "SKU-4471-BLK",
"version": 4,
"livemode": true,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-01T14:03:22.501Z",
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"gtin": "03453120000011"
}
}
],
"has_more": false,
"next_cursor": null
}GET /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports?status=published&limit=25
创建护照。
/organizations/{organization}/passports- 作用域
- passports:write
Idempotency-Key- 接受
- 返回
- 201
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
请求体
categorystring必填来自 GET /categories 的类别 id。它决定了字段架构,创建之后无法更改。
external_idstring可选您自己为该产品指定的标识符,长度 1 到 255 个字符。在组织和模式内唯一,因此您无需保存我们的 id 也能完成对账;同一个 id 可以在测试模式和正式模式中各存在一次。
dataobject可选护照文档。键名取自该类别的字段架构,另外还包括每个可附文件字段的 document_id_key 配套键;其余键会被拒绝,而不是被悄悄存下。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 429rate_limited
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"category": "textile",
"external_id": "SKU-4471-BLK",
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR"
}
}'{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "draft",
"gtin": null,
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 1,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-01T09:12:44.918Z",
"published_at": null,
"trashed_at": null,
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
]
}
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports
获取单个护照。
/organizations/{organization}/passports/{id}- 作用域
- passports:read
Idempotency-Key- 不接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41" \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "published",
"gtin": "03453120000011",
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 4,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-01T14:03:22.501Z",
"published_at": "2026-08-01T14:03:22.501Z",
"trashed_at": null,
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"gtin": "03453120000011"
}
}GET /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41
对护照应用 JSON Merge Patch。
/organizations/{organization}/passports/{id}- 作用域
- passports:write
Idempotency-Key- 接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
请求头
If-Matchstring可选读取护照时返回的 ETag。若护照在此期间已被改动,写入会被 precondition_failed 拒绝,这是让读取-修改-写入在并发编辑面前保持安全的唯一办法。
请求体
dataobject可选对护照文档应用的 RFC 7386 JSON Merge Patch。省略某个键即保持原值不动;传入 null 则删除它。数组一律整体替换,绝不合并。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 412precondition_failed
- 429rate_limited
- 404resource_not_found
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
- 409wrong_status
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41" \
-X PATCH \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"data": {
"recycled_content_percentage": 38,
"recycling_instructions": "Return to any Atelier Kestrel store for fibre recovery."
}
}'{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "draft",
"gtin": null,
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 2,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-01T10:44:12.700Z",
"published_at": null,
"trashed_at": null,
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"recycled_content_percentage": 38,
"recycling_instructions": "Return to any Atelier Kestrel store for fibre recovery."
}
}PATCH /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41
发布护照。
/organizations/{organization}/passports/{id}/publish- 作用域
- passports:write
Idempotency-Key- 接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 422document_missing
- 422gtin_required
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 402publish_limit_reached
- 429rate_limited
- 404resource_not_found
- 503storage_unavailable
- 402unit_limit_reached
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
- 409wrong_status
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/publish" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "published",
"gtin": "03453120000011",
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 4,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-01T14:03:22.501Z",
"published_at": "2026-08-01T14:03:22.501Z",
"trashed_at": null,
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"gtin": "03453120000011"
},
"warnings": [
{
"code": "environmental_claim_detected",
"message": "This passport contains environmental claim language (carbon neutral). From 27 September 2026, Directive (EU) 2024/825 requires the trader placing the product on the market to hold substantiation for such claims. Publishing succeeded; confirm the substantiation exists.",
"doc_url": "https://passportcraft.com/docs/api/errors#environmental_claim_detected"
}
]
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/publish
取消发布护照。
破坏性/organizations/{organization}/passports/{id}/unpublish- 作用域
- passports:write
Idempotency-Key- 接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 412precondition_failed
- 429rate_limited
- 404resource_not_found
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
- 409wrong_status
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/unpublish" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "draft",
"gtin": "03453120000011",
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 5,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-02T08:15:09.113Z",
"published_at": null,
"trashed_at": null,
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"gtin": "03453120000011"
}
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/unpublish
将护照移入回收站。
破坏性/organizations/{organization}/passports/{id}/trash- 作用域
- passports:write
Idempotency-Key- 接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 412precondition_failed
- 429rate_limited
- 404resource_not_found
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
- 409wrong_status
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/trash" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "trashed",
"gtin": "03453120000011",
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 6,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-02T08:19:44.002Z",
"published_at": null,
"trashed_at": "2026-08-02T08:19:44.002Z",
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"gtin": "03453120000011"
}
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/trash
从回收站恢复护照。
/organizations/{organization}/passports/{id}/restore- 作用域
- passports:write
Idempotency-Key- 接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 409idempotency_conflict
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 409not_trashed
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 412precondition_failed
- 429rate_limited
- 404resource_not_found
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/restore" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"{
"object": "passport",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"category": "textile",
"status": "draft",
"gtin": "03453120000011",
"serial_number": null,
"external_id": "SKU-4471-BLK",
"version": 7,
"livemode": true,
"registry_id": null,
"created_at": "2026-08-01T09:12:44.918Z",
"updated_at": "2026-08-02T08:21:03.884Z",
"published_at": null,
"trashed_at": null,
"data": {
"product_name": "Merino Crew Neck",
"product_description": "Mid-weight knitted crew neck in 100% merino wool.",
"manufacturer_name": "Atelier Kestrel SAS",
"manufacturer_address": "14 rue des Tanneurs, 59100 Roubaix",
"manufacturer_country": "FR",
"material_composition": [
{
"fiber": "Merino wool",
"percentage": 100
}
],
"substances_of_concern": [
{
"name": "None declared",
"present": false
}
],
"gtin": "03453120000011"
}
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/restore
按类别架构校验护照,但不保存。
/organizations/{organization}/passports/{id}/validate- 作用域
- passports:read
Idempotency-Key- 不接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
请求体
dataobject可选校验前先合并进来的字段,您可以据此试验一次修改而不保存它。无论结果如何,都不会写入任何内容。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 429rate_limited
- 404resource_not_found
- 503storage_unavailable
- 415unsupported_media_type
- 422validation_failed
- 400wildcard_not_supported
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/validate" \
-X POST \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"material_composition": null
}
}'{
"object": "validation",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/validation",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"passport_id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"category": "textile",
"schema_version": "1.0.0-draft",
"dry_run": true,
"valid": false,
"publishable": false,
"error_count": 2,
"warning_count": 0,
"checked_at": "2026-08-02T08:26:11.409Z",
"issues": [
{
"object": "validation_issue",
"field": "material_composition",
"source": {
"pointer": "/data/material_composition"
},
"rule": "required",
"severity": "error",
"message": "Material Composition is required",
"message_key": "required",
"message_params": {
"field": "Material Composition"
},
"writable_via_api": true
},
{
"object": "validation_issue",
"field": "gtin",
"source": {
"pointer": "/data/gtin"
},
"rule": "required",
"severity": "error",
"message": "A GTIN is required before this passport can be published.",
"writable_via_api": true
}
]
}POST /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/validate
获取公开页面 URL 与 GS1 Digital Link。
/organizations/{organization}/passports/{id}/links- 作用域
- passports:read
Idempotency-Key- 不接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/links" \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"{
"object": "passport_links",
"id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"name": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/links",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"passport": "organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"status": "published",
"livemode": true,
"gtin": "03453120000011",
"serial_number": null,
"public_url": "https://passportcraft.com/passport/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"qr_target": "https://passportcraft.com/01/03453120000011",
"gs1_digital_link": {
"uri": "https://passportcraft.com/01/03453120000011",
"gtin14": "03453120000011",
"serial": null,
"linkset_url": "https://passportcraft.com/01/03453120000011?linkType=linkset",
"unavailable_reason": null
},
"resolves_publicly": true,
"not_resolvable_reason": null
}GET /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/links
解除文档与护照的关联;若无其他护照使用该文档,则将其从文档库中删除。
/organizations/{organization}/passports/{id}/documents/{documentId}- 作用域
- documents:write
Idempotency-Key- 不接受
- 返回
- 200
路径参数
organizationstring必填本次请求代为操作的组织。密钥必须已获得该组织的授权。
idstring必填资源的标识符。请把它当作不可解析的字符串处理。
documentIdstring必填资源的标识符。请把它当作不可解析的字符串处理。
错误
该端点可能返回的全部拒绝,以及它们所带的 HTTP 状态码。
- 500configuration_error
- 403insufficient_scope
- 500internal_error
- 401invalid_key
- 400invalid_request
- 401key_expired
- 401key_revoked
- 401key_rotated
- 400mode_mismatch
- 402no_subscription
- 404organization_not_found_or_not_granted
- 413payload_too_large
- 402payment_overdue
- 429rate_limited
- 409resource_busy
- 404resource_not_found
- 400wildcard_not_supported
curl "https://passportcraft.com/api/v1/organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents/a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b" \
-X DELETE \
-H "Authorization: Bearer $PASSPORTCRAFT_API_KEY"{
"object": "document.deleted",
"id": "a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b",
"organization_id": "8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2",
"passport_id": "2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41",
"livemode": true,
"detached": true,
"deleted_from_library": true,
"remaining_links": 0,
"document_limit": 50
}DELETE /organizations/8f14e45f-ceea-467a-9a5f-8dc7d9c6a1b2/passports/2c1f9e07-3b4d-4a18-9f6c-5e0a7b8d3c41/documents/a3b8c2d1-5e64-4f79-8a0b-1c2d3e4f5a6b