Customers

Create a customer

Through a click (click_id, the referral's identity carries over and the partner is whoever owns it) or directly to a partner (partner_id, recorded as tracked_by: api). Set external_customer_id so charges you send later match.

Scope: commissions:write (or write)

post/v1/customers

Request

  • Base URL: https://api.affiliaterail.com
  • URL: https://api.affiliaterail.com/v1/customers
  • Auth: HTTP bearer

Request body

program_idstring required

Prefixed id (prg_…)

partner_idstring

Attribute directly to a partner

click_idstring

Or attribute through the click the visitor arrived on (one of partner_id or click_id is required)

emailstring email
namestring
identifierstring

Your own id for this customer

external_customer_idstring

The processor's customer id, used to match incoming charges

status'lead' | 'trial' | 'active' | 'cancelled' | 'suspended'
metadataobject nullable

Your own key/value data, stored as given

Example request

{
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "click_id": "clk_7uSyy9FqVLCFWrdPeZaK"
}

Response

The new customer

idstring required

Prefixed id (cus_…)

object'customer' required
program_idstring required

Prefixed id (prg_…)

partner_idstring required

Prefixed id (part_…)

referral_idstring nullable required

Prefixed id (ref_…)

link_idstring nullable required

Prefixed id (lnk_…)

coupon_idstring nullable required

Prefixed id (cpn_…)

processor'stripe' | 'paddle' | 'chargebee' | 'manual' | 'api' | 'null' nullable required
external_customer_idstring nullable required
external_subscription_idstring nullable required
emailstring nullable required
namestring nullable required
identifierstring nullable required
status'lead' | 'trial' | 'active' | 'cancelled' | 'refunded' | 'suspended' required
tracked_by'link' | 'coupon' | 'manual' | 'api' required
lead_atstring date-time nullable required

ISO-8601, UTC

converted_atstring date-time nullable required

ISO-8601, UTC

metadataobject nullable required

Your own key/value data, stored as given

created_atstring date-time required

ISO-8601, UTC

updated_atstring date-time required

ISO-8601, UTC

Example response

{
  "id": "cus_7uSyy9FqVLCFWrdPeZaK",
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "referral_id": "ref_7uSyy9FqVLCFWrdPeZaK",
  "link_id": "lnk_7uSyy9FqVLCFWrdPeZaK",
  "coupon_id": "cpn_7uSyy9FqVLCFWrdPeZaK",
  "lead_at": "2026-08-21T10:15:30.000Z",
  "converted_at": "2026-08-21T10:15:30.000Z",
  "created_at": "2026-08-21T10:15:30.000Z",
  "updated_at": "2026-08-21T10:15:30.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.