Payments API

For payment sources without a built in integration. Create a key under Integrations. Keys are shown once, can be limited to one website, and have scopes: payments:write, payments:read, goals:write, crawlers:write, and stats:read for AI assistants. A key with no scopes chosen gets every scope except stats:read.

Record a payment

curl -X POST https://datafair.dev/api/v1/payments \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "website_id": "PUBLIC_SITE_ID", "transaction_id": "order_8214", "amount_minor": 2900, "currency": "USD", "visitor_id": "VALUE_OF_df_vid_COOKIE", "email": "buyer@example.com", "subscription_id": "sub_1042", "timestamp": "2026-10-31T12:00:00Z" }'

Look up a payment

curl https://datafair.dev/api/v1/payments/order_8214?website_id=PUBLIC_SITE_ID \ -H "Authorization: Bearer YOUR_API_KEY"

Record a server side goal

curl -X POST https://datafair.dev/api/v1/goals \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"website_id":"PUBLIC_SITE_ID","visitor_id":"VISITOR_ID","name":"signup","idempotency_key":"signup-12345"}'

Errors

400 invalid input. 401 missing or invalid key. 403 key lacks the scope. 404 not found. 429 monthly event limit reached (goals only).

Documentation