Skip to main content
POST
/
affiliates
Create affiliate
curl --request POST \
  --url https://api.affonso.io/v1/affiliates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "email": "[email protected]",
  "program_id": "<string>",
  "tracking_id": "<string>",
  "group_id": "<string>",
  "company_name": "<string>",
  "country_code": "<string>",
  "payout_method": "paypal",
  "payout_details": {
    "email": "[email protected]",
    "accountId": "<string>",
    "address": "<string>",
    "bankName": "<string>",
    "accountNumber": "<string>",
    "swiftCode": "<string>",
    "iban": "<string>",
    "routingNumber": "<string>",
    "accountName": "<string>"
  },
  "onboarding_completed": false,
  "external_user_id": "<string>",
  "metadata": {}
}
'
{
  "success": true,
  "data": {
    "id": "<string>",
    "name": "<string>",
    "email": "<string>",
    "tracking_id": "<string>",
    "source": "<string>",
    "partnership_status": "PENDING",
    "onboarding_completed": true,
    "program_id": "<string>",
    "group_id": "<string>",
    "external_user_id": "<string>",
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Prefix with 'sk_live_' for production or 'sk_dev_' for development.

Body

application/json
name
string
required

Affiliate name

Required string length: 1 - 100
email
string<email>
required

Affiliate email

program_id
string
required

Program ID to enroll the affiliate in

tracking_id
string

Custom tracking ID for the affiliate. Must contain only lowercase letters, numbers, and hyphens. If not provided, a tracking ID will be generated automatically from the affiliate's name.

Required string length: 1 - 100
group_id
string

Group ID to assign the affiliate to. If not provided, the program's default group will be used automatically.

company_name
string
Maximum string length: 100
country_code
string

ISO 3166-1 alpha-2 country code

Required string length: 2
payout_method
enum<string>
Available options:
paypal,
wise,
payoneer,
paxum,
webmoney,
skrill,
wire_transfer,
bitcoin,
ethereum,
alipay,
wechat,
manual,
none
payout_details
object
onboarding_completed
boolean
default:false

Set to true to skip the onboarding flow, false to require the affiliate to complete onboarding

external_user_id
string

Your external user ID for linking referral users to your own user system

Maximum string length: 255
metadata
object

Custom key-value data for storing additional information

Response

Affiliate created

success
boolean
data
object