API ReferenceWooCommerceSDKssoonWebhookssoon

Referrals

Create referral code

POST/beltempo/referral/create

Create a per-ambassador referral code. Codes are scoped to your merchant — other merchants can't see or list them.

  • Authenticated: API key or merchant JWT. An unauthenticated call returns 401.

Authentication

Accepts either an API key (X-API-Key) or a dashboard JWT (Authorization: Bearer …).

Body parameters

user_idstringrequired

the ambassador this code belongs to — or pass user_email instead

user_emailstringoptional

alternative to user_id: resolves to an existing customer by email

codestringrequired

2–64 chars, a–z 0–9 _ -

referrer_cashback_percentnumberoptional
referred_cashback_percentnumberoptional
POST/beltempo/referral/create
curl --request POST "https://api.trevi.cash/beltempo/referral/create" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: $TREVI_API_KEY" \
  --data '{ "user_id": "user_abc...", "code": "alice2026" }'