保存签到
创建签到记录。API 会根据会员、设施和时间戳自动去重。
参数
-
check_ins
array必填要保存的签到对象数组。为获得最佳性能,建议每个请求最多 1000 个项目。API 会自动对项目进行分批处理。每个项目必须包含
facility_id(未使用linking_identifier时必填)或linking_identifier(未使用facility_id时必填)。
返回值
返回一条确认同步操作的简单消息。
请求
curl -X POST https://partner-api.performancehub.co/partner/v1/check-ins \
-u sk_live_YOUR_PARTNER_SECRET_KEY: \
-H "Content-Type: application/json" \
-d '{
"check_ins": [
{
// "check_in_id": "checkin_abc123", // Optional - auto-generated from member_id + timestamp if not provided
"member_id": "mem_12345",
"facility_id": "550e8400-e29b-41d4-a716-446655440000",
// "linking_identifier": "branch_downtown", // If using linking identifier
"check_in_type": "member",
"source": "rfid",
"timestamp": "2025-01-20T08:45:30Z"
}
]
}'
响应
返回一条成功消息,其中包含有关同步操作的元数据。
{
"message": "Check-in sync successful.",
"metadata": {
"success": 523,
"skipped": 3,
"skipped_items": [
{
"member_id": "member_789",
"facility_id": null,
"reason": "No matching facility_id for the linking_identifier"
}
]
}
}
元数据字段:
- success:成功处理的签到数量
- skipped:跳过的签到数量(如有)
- skipped_items:跳过的签到及原因的数组(如有)
- dry-run:使用 dryrun 密钥类型时的布尔标志(如适用)