LogoLogo
REST APIWebhooksHelp Center →
  • Introduction
  • JavaScript API
    • Overview
  • REST API
    • Overview
    • Campaigns
      • The campaign object
      • List campaigns
      • Create campaign
      • Retrieve campaign
      • Update campaign
    • Affiliates
      • The affiliate object
      • List affiliates
      • Create affiliate
      • Retrieve affiliate
      • Update affiliate
      • Magic Link (SSO)
    • Affiliate Links
      • The affiliate link object
      • List affiliate links
      • Create affiliate link
      • Retrieve affiliate link
      • Update affiliate link
    • Affiliate Coupons
      • The affiliate coupon object
      • List affiliate coupons
      • Create affiliate coupon
      • Retrieve affiliate coupon
    • Referrals
      • The referral object
      • List referrals
    • Commissions
      • The commission object
      • List commissions
      • Retrieve commission
      • Update commission
      • Delete commission
    • Payouts
      • The payout object
      • List payouts
      • Retrieve a payout
      • Mark a payout as paid
  • Webhooks
    • Overview
    • Endpoints
    • Requests
    • Event types
    • Signed webhooks
  • Links
    • Help Center
    • Sign up
    • Login
    • Learn more about Rewardful
Powered by GitBook
On this page
  • Request
  • Parameters
  • Example
  • Response

Was this helpful?

Export as PDF
  1. REST API
  2. Affiliates

Create affiliate

Creates a new affiliate in your account with the specified parameters.

PreviousList affiliatesNextRetrieve affiliate

Last updated 2 years ago

Was this helpful?

This endpoint allows merchants to create affiliates on demand.

Both normal affiliates and customer referrers can be created through this endpoint. To create a customer referrer, simply pass the stripe_customer_id parameter that indicates the Stripe Customer that should receive account credits as rewards.

Rewardful does not send a "Welcome Email" or require email confirmation for affiliates created through the REST API. If you would like to send a "Welcome Email" to these affiliates, you can do so from your application after making the API call, respond to the , or configure on of our .

Request

Method

URL

POST

https://api.getrewardful.com/v1/affiliates

Parameters

Parameter

Required?

Description

first_name

Yes

The affiliate's first name.

last_name

Yes

The affiliate's last name.

email

Yes

The affiliate's email address.

state

No

stripe_customer_id

No

For customer referral programs, this is the Stripe Customer that will receive account credits as rewards. Note: the customer must exist in your Stripe account in livemode.

token

No

Alphanumeric code to be used for links, ex: ?via=token Must contain only letters, numbers, and dashes.

campaign_id

No

The UUID of the campaign this affiliate should be added to. Affiliate will be added to your default campaign if this parameter is

blank.

paypal_email

No

The PayPal address that commissions should be paid to.

wise_email

No

The Wise address that commissions should be paid to.

receive_new_commission_notifications may also be optionally provided. This parameter indicates whether or not the affiliate should receive emails when new rewards and commissions are earned. Accepts true (default) or false.

Example

curl --request POST \
  --url https://api.getrewardful.com/v1/affiliates \
  -u YOUR_API_SECRET: \
  -d first_name=James \
  -d last_name=Bond \
  -d email=jb007@mi6.co.uk \
  -d token=jb007 \
  -d stripe_customer_id=cus_ABC123

Response

Response code

Body

200

Invalid parameters

Response code

Body

422

JSON object describing validation errors.

{
  "error": "Could not create affiliate.",
  "details": ["Email can't be blank"]
}

Authentication failure

Response code

Body

401

Description of the authentication failure.

{  "error": "Invalid API Secret." }

A string indicating the . Defaults to active.

An (JSON)

affiliate.created webhook
email integrations
affiliate object
affiliate's state