Create an affiliate attribution by handle

Server-side equivalent of the ?mref=<handle> install path. Resolves the
affiliate handle within this app's affiliate program and creates an
attribution against the customer's current app installation. Use this when
a referrer code is collected after install (e.g. paste-at-checkout) and
you don't want to wait for the GA4 → BigQuery attribution pipeline.

Idempotent. If any active attribution already exists for this customer's
app installation, the existing attribution is returned (200) and no
further side effects fire — first write wins. Only when no attribution
exists does this create one (201), fire program rules, enqueue
commission calculation, and dispatch the affiliates/referral webhook.

Auth is app-scoped only (X-Mantle-App-Id + X-Mantle-App-Api-Key with the
customerId in the body). Customer-scoped tokens are rejected — this
endpoint is intended for server-to-server use.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required

The membership handle (the same value that appears in ?mref=<handle> URLs).

string
required

Customer ID, Shopify domain, platformId, or app installation id.

Responses

400

Missing affiliateHandle or customerId

404

Customer not found, no affiliate program, or handle does not match a membership in this program

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json