Chronosfy API — curl 快速入门
需要 curl;将 AUTH 设置为"ApiKey . . " 或"Bearer . ” 从 POST /auth/login.
BASE='https://chronosfy.com/api'
curl --fail-with-body "$BASE/crm/persons" -H "Authorization: $AUTH" -H 'Content-Type: application/json' -H 'Idempotency-Key: person:customer-42:v1' -d '{"name":"Alice","email":"[email protected]","external_id":"customer-42","metadata":{"source":"integration"}}'
curl --fail-with-body "$BASE/actions" -H "Authorization: $AUTH" -H 'Content-Type: application/json' -H 'Idempotency-Key: action:reminder:v1' -d '{"name":"Monthly reminder","type":"email","template":{"subject":"Reminder","body_html":"<p>Hello</p>"}}'
# Use the returned IDs as PERSON_ID and ACTION_ID, then create the recurrence:
curl --fail-with-body "$BASE/recurrences" -H "Authorization: $AUTH" -H 'Content-Type: application/json' -H 'Idempotency-Key: recurrence:subscription-42:v1' -d '{"name":"Monthly reminder","subject_type":"person","frequency_config":{"type":"monthly","day":31,"time":"09:00","timezone":"Europe/London"},"client_reference":"subscription-42","action_id":"ACTION_ID","subject_id":"PERSON_ID"}'使用一个范围 API 键或一个 JWT 从 POST /auth/login. 每个逻辑请求保留一个稳定密钥,包括在超时或进程重新启动后。使用相同的密钥更改有效载荷返回 409.
创建密钥对于人员/操作/重复是可选的,对于付款链接是必需的。 MCP 使用 request_key。
external_id 在租户的活动人员中是独一无二的; client_reference 是 non-unique 业务参考。
为 one-off 购买、循环注册或独立卡片存储,请参阅 /docs/quickstart/checkout 对于托管 URL 和嵌入式 SDK.
对于 Stripe Elements 的直接设置,请配置经过验证的 PSP,并使用 Stripe.js 中的 /payment/setup-intent 。
Checkout 可以使用 save_payment_method 保存卡片;first_run_at 设置最早的自动重复。
有关完整的 HTTP/MCP 流程、权限和恢复,请参阅 /docs/quickstart/renewals 。
如果收到 502 响应或结果未知,请重用原来的密钥。不要为同一笔付款创建新的支付标识。