Rafobase Logo

Create a member

Register a new member in your referral program. A unique coupon code will be automatically generated.

POST
/members

Register a new member in your referral program. A unique coupon code will be automatically generated.

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

In: header

Request Body

application/json

email*string

Unique email address

Formatemail
name*string

Display name

external_id?string

Your system's customer ID

campaign_id?string

Campaign to assign (uses default if omitted)

metadata?

Custom key-value data

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api-base.rafo.work/api/v1/members" \  -H "Content-Type: application/json" \  -d '{    "email": "customer@example.com",    "name": "John Doe",    "external_id": "cust_123",    "campaign_id": "camp_xxxxx"  }'
{
  "data": {
    "id": "mem_xxxxx",
    "email": "john@example.com",
    "name": "John Doe",
    "external_id": "cust_123",
    "coupon_code": "NUT-JOHN-A7X",
    "campaign_id": "camp_xxxxx",
    "status": "active",
    "wallet": {
      "pending": 0,
      "available": 0,
      "currency": "BRL"
    },
    "stats": {
      "total_referrals": 0,
      "total_earnings": 0
    },
    "metadata": {},
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "validation_error",
    "message": "Invalid request parameters"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}
{
  "error": {
    "code": "email_exists",
    "message": "A member with this email already exists"
  }
}