Skip to Content
Referhatch
Tools

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

FieldTypeDescription
affiliate_idstringAffiliate ID in your account. Provide this or a referral code.
referral_codestringReferral code in your account. Provide this or an affiliate ID.
purchase_reference (required)stringYour unique order reference. Reuse it to retry the same purchase.
amount (required)numberAmount in currency units: 100 means USD 100. Up to two decimals; whole units for JPY.
currencystringPurchase currency. Defaults to USD. Reports never combine currencies.
occurred_atstringUTC event time, such as 2026-11-01T12:00:00Z. Defaults to now.

Output

FieldTypeDescription
ok (required)boolean
errorobject
purchaseobject
duplicateboolean