Chronosfy API — how to start with Python
Install requests. Set CHRONOSFY_AUTH to API key wey get di right scope or JWT from POST /auth/login.
import os, json, requests
BASE = "https://chronosfy.com/api"
def create(path, body, key):
response = requests.post(BASE + path, json=body, timeout=30, headers={
"Authorization": os.environ["CHRONOSFY_AUTH"], "Idempotency-Key": key})
response.raise_for_status()
return response.json()
person = create('/crm/persons', json.loads('{"name":"Alice","email":"[email protected]","external_id":"customer-42","metadata":{"source":"integration"}}'), 'person:customer-42:v1')
action = create('/actions', json.loads('{"name":"Monthly reminder","type":"email","template":{"subject":"Reminder","body_html":"<p>Hello</p>"}}'), 'action:reminder:v1')
schedule = json.loads('{"name":"Monthly reminder","subject_type":"person","frequency_config":{"type":"monthly","day":31,"time":"09:00","timezone":"Europe/London"},"client_reference":"subscription-42"}')
schedule.update(action_id=action['id'], subject_id=person['id'])
recurrence = create('/recurrences', schedule, 'recurrence:subscription-42:v1')Use API key wey get di right permissions or JWT from POST /auth/login. Keep one key for each logical request, even after timeout or restart. If you change di payload but use di same key, you go get 409.
Creation keys na optional for people, actions and schedules wey dey repeat. Payment links need dem. MCP dey use request_key.
external_id must dey unique among active people for one tenant. More than one business record fit share di same client_reference.
For one-time purchases, agreement to pay regularly, or to save card only, see /docs/quickstart/checkout for di hosted URL and embedded SDK.
To use Stripe Elements directly, set up verified PSP and use /payment/setup-intent with Stripe.js.
Checkout fit save card with save_payment_method. first_run_at dey set di earliest time di automatic schedule fit run.
See /docs/quickstart/renewals for all di HTTP/MCP steps, permissions and how to recover.
If you get 502 or you no know di result, use di original key again. No create another payment ID for di same payment.