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.
curl https://api.referhatch.com/v1/record_purchase \
-H "Authorization: Bearer $API_KEY" \
-d '{"purchase_reference":"your purchase reference","amount":0}'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. |
purchase_reference (required) | string | Your unique order reference. Reuse it to retry the same purchase. |
amount (required) | number | Amount in currency units: 100 means USD 100. Up to two decimals; whole units for JPY. |
currency | string | Purchase currency. Defaults to USD. Reports never combine currencies. |
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 | |
purchase | object | |
duplicate | boolean |
View attributed purchases
Retrieve purchases in your account with their affiliate, saved commission and currency. Filter by affiliate, exact order reference or an inclusive UTC date range. Use next_offset when has_more is true.
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.