Record a referral visit
Record one visit against an affiliate ID or referral code in your account. Each call, including retries, records a new visit and consumes one tracking block. Your site must submit visits; Referhatch does not collect them automatically.
curl https://api.referhatch.com/v1/record_visit \
-H "Authorization: Bearer $API_KEY" \
-d '{}'Input
| Field | Type | Description |
|---|---|---|
affiliate_id | string | Affiliate ID in your account. Provide this or a referral code. |
referral_code | string | Referral code in your account. Provide this or an affiliate ID. |
occurred_at | string | UTC event time, such as 2026-11-01T12:00:00Z. Defaults to now. |
Output
| Field | Type | Description |
|---|---|---|
ok (required) | boolean | |
error | object | |
visit | object |
Record an attributed purchase
Submit an order reference, amount and affiliate ID or referral code. Referhatch calculates commission at the current rate. References are unique per account: identical retries return the original purchase; a changed amount, currency or affiliate returns a conflict. Negative amounts or affiliates unavailable in your account return a validation error without changing purchases or commissions. Each call, including retries, consumes one tracking block. Recording commission does not pay affiliates.
Register an affiliate
Create an affiliate in Referhatch and get a referral code. Set a commission percentage; 10 means 10%. Registration does not record a visit or purchase.