v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Referrals

Add Referral Code Holders with Campaign ID

Adds new holders to a referral code as referees. The data sent in the request is upserted into the customer data.

If the request returns an error even for one customer, you have to resend the whole request. Customer data is upserted if the data for all customers is correct.

To use this endpoint, you must have the following permissions:

  • Create and modify Customers and Segments (customers.modify)
  • Publish Voucher (vouchers.publish)

👍 To add a holder as a referrer, use the Create Publication endpoint.

post/v1/referrals/{campaignId}/members/{memberId}/holders

Request body

metadataobject

A set of custom key/value pairs that you can attach to the redeemable holders sent in the array. The value can be a string, number, boolean, date, datetime, image URL, or object. The metadata must meet the metadata schema for publications. The metadata object stores all custom attributes assigned to the redeemable holder.

Response

Returns a list of redeemable holder objects.

Example response

{
  "holders": [
    {
      "id": "rh_0e7b8db4700106a852",
      "created_at": "2024-03-22T17:48:25.910Z",
      "redeemable_id": "v_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1",
      "redeemable_object": "voucher",
      "customer_id": "cust_p1ufreYbVbwZ1x70nFkH9rF9",
      "holder_role": "OWNER",
      "campaign_id": "camp_weer1c3p5ZgktqfW56RfoNaG",
      "campaign_type": "REFERRAL_PROGRAM",
      "voucher_type": "DISCOUNT_VOUCHER"
    }
  ]
}