PUT
/
referrals
/
{id}
Update referral
curl --request PUT \
  --url https://v2.firstpromoter.com/api/v2/company/referrals/{id} \
  --header 'Account-ID: <account-id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "[email protected]",
  "uid": "<string>",
  "username": "<string>",
  "promoter_campaign_id": 123,
  "find_by": "email",
  "split_details[percentage]": 0,
  "split_details[promoter_campaign_id]": 0
}'
{
  "id": 123,
  "email": "[email protected]",
  "uid": "<string>",
  "state": "subscribed",
  "metadata": {},
  "entry_source": "api",
  "created_at": "2023-11-07T05:31:56Z",
  "customer_since": "2023-11-07T05:31:56Z",
  "promoter_campaign": {
    "id": 123,
    "campaign_id": 123,
    "promoter_id": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "promoter": {
      "id": 123,
      "email": "[email protected]",
      "name": "<string>"
    },
    "campaign": {
      "id": 123,
      "name": "<string>",
      "color": "<string>"
    }
  },
  "fraud_check": "no_suspicion",
  "created_by_user_email": "[email protected]"
}

Authorizations

Authorization
string
header
required

API key passed as a Bearer token in the Authorization header. You can find your API Key on Your FirstPromoter Dashboard. Navigate to Settings → Integrations → Manage API Keys

Headers

Account-ID
string
required

Account id. You can find your Account ID on Your FirstPromoter Dashboard. Navigate to Settings → Integrations

Path Parameters

id
string
required

ID of the referral

Body

application/json
email
string<email>

Email address of the referral, this is required if the uid is null

uid
string

UID of the referral, this is required if the email is null

username
string

Username of the referral.

Note: Reach out to us on support if you need this.It needs to be enabled before you can use it.

promoter_campaign_id
integer

Promoter campaign ID, you can obtain this for each promoter form the promoters endpoint. It is the id that pairs a promoter to a campaign. Not the campaign id.

find_by
enum<string>

Find by attribute. Required when id parameter is an email, uid, or username instead of an ID.

Your request should follow the format https://v2.firstpromoter.com/api/v2/company/referrals/{email or uid or username}

Available options:
email,
uid,
username
split_details[percentage]
number
default:0

Percentage vale of the split between 0 and 100.

Note: Reach out to us on support if you need this.It needs to be enabled before you can use it.

split_details[promoter_campaign_id]
integer
default:0

Promoter campaign ID, on which you want the split on.

Note: Reach out to us on support if you need this.It needs to be enabled before you can use it.

Response

Referral updated successfully

id
integer

Id of the referral

email
string<email>

Email address of the referral

uid
string

uid of the referral

state
enum<string>

State of the referral

Available options:
subscribed,
signup,
active,
cancelled,
refunded,
denied,
pending,
moved
metadata
object

Additional metadata of the referral

entry_source
enum<string>

Entry source of the referral. This shows where the referral was captured from. Cookie is set if the referral was captured using the tid cookie, Coupon is for when the referral is captured via a coupon code. Manual admin is for when the referral is added manually by an admin. Manual affiliate is for when the referral is added manually by an affiliate.

Available options:
api,
coupon,
cookie,
manual_admin,
manual_affiliate
created_at
string<date-time>

Date and time when the referral was created

customer_since
string<date-time> | null

Date and time when the referral became a customer

promoter_campaign
object
fraud_check
enum<string>

Fraud check result of the referral

Available options:
no_suspicion,
same_ip_suspicion,
same_promoter_email,
ad_source
created_by_user_email
string<email> | null

Email address of the user who created the referral