Hanzo
OpenapiAffiliate

Records the first-touch edge every later commission is computed from: the…

Records the first-touch edge every later commission is computed from: the caller's org was referred by the affiliate that owns this code.

POST /v1/affiliate/attribute

Addresshttps://api.hanzo.ai/v1/affiliate/attribute
MethodPOST
Operationpost_affiliate_attribute
AuthAuthorization: Bearer $HANZO_API_KEY

Records the first-touch edge every later commission is computed from: the caller's org was referred by the affiliate that owns this code.

The REFERRED org is the validated caller, never a field. A caller that could name the referred org could attach itself to somebody else's revenue. The affiliate is resolved from the code, and only an APPROVED affiliate's code resolves.

FIRST TOUCH WINS, set once: one affiliate per referred org, so a re-post answers the existing edge with created:false rather than moving the attribution. Self-attribution is refused, and so is a code that would make a cycle in the upline chain. An unknown code is a 404, deliberately: an affiliate code IS a public shareable link, so whether one is real is public by design, and the caller legitimately needs to know its link resolved.

A user-level mirror of the edge is written best-effort; a conflict there never fails the org attribution, which is the money-bearing one.

Request

1 field, body application/json (required).

FieldInTypeRequiredDescription
codebodystringCode is the affiliate code the referred org arrived with.

Response

StatusBodyMeaning
200attributionok
201attributioncreated

200 body — 4 fields.

FieldInTypeAlwaysDescription
codebodystringCode is the affiliate code the edge was recorded under, normalized to lower case.
createdbodybooleanCreated says whether THIS call made the edge. false means the caller org was already attributed and nothing moved.
createdAtbodyintegerCreatedAt is when the edge was FIRST recorded, Unix seconds UTC.
idbodystringID is the attribution edge's server-minted handle, "afr_"-prefixed.

Failure carries the platform error shape — see Errors.

Examples

hanzo affiliates attribute

Affiliate API · All Hanzo APIs · Interactive reference

How is this guide?

On this page