POST/v1/customers/{external_id}/referral-codes
Get a customer's referral code
Returns the customer's code for a referral offer, creating it on the first ask, with an optional code the business chooses. Needs customers:write or billing:self.
curl -X POST 'https://api.entitler.co/v1/customers/ada/referral-codes' \
-H "Authorization: Bearer $ENTITLER_KEY" \
-H "Content-Type: application/json" \
-d '{"code":"code","offerKey":"offerKey","target":{"environmentId":"environmentId","projectId":"projectId","teamId":"teamId"}}'Credentials
Send any one of these:
- Bearer token
Path parameters
| Name | Type | Description |
|---|---|---|
external_idrequired | string | The customer's external ID, or me for the customer a customer token or identity token names. |
Request body
object
codestringofferKeystringtargetProductTargetenvironmentIdstringprojectIdstringteamIdstring
Responses
200The GetReferralCodeResponse message.
GetReferralCodeResponse
createdbooleanrequiredreferralCodeReferralCodecodestringrequiredcreatedAtintegerrequiredat least 0; at most 18446744073709552000
idstringrequiredmaxUsesinteger (int64)requiredat least 0; at most 4294967295
offerIdstringrequiredofferKeystringrequiredusesintegerrequiredat least 0; at most 18446744073709552000
ErrorA refusal, with the HTTP status of its gRPC code.
Error
errorobjectrequiredcodestringrequiredparametersobjectrequiredEach value: string
reasonstringor nullrequired