younifyd
Menu

Referrals Add Holders

Add Referral Code Holders

POST/v1/referrals/members/{memberId}/holders

Use it in a workflow

  1. Add a step and choose the Voucherify connector.
  2. Pick the Referrals Add Holders action (under Referrals).
  3. Fill in the fields below, then reference the result from later steps as {{referralsAddHolders.response.data}}.

Request

Path parameters

memberIdstringrequired

Unique referral code or its identifier.

Request body

Enter the body as JSON in the step's Body field.

holdersarray<any>

Array of holders to be added to a referral card as referees. You have to send at least one object in the array up to a maximum of 100 objects. You can send either a `source_id` or `id`, or both; however, at least one of them is required. If both are sent, Voucherify checks `id` to upsert that customer's data.

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.

json
{
  "holders": [
    null
  ],
  "metadata": {}
}

Response

Returns 200 with an object. Read it in later steps with {{referralsAddHolders.response.data.<field>}}.

holdersarray<object>

Contains an array of referral card holders who are the customers sent in the request.

idstring

Unique identifier of the redeemable holder.

created_atstring (date-time)

Timestamp representing the date and time when the redeemable was assigned. The value is shown in the ISO 8601 format.

redeemable_idstring

Identifier of the redeemable item.

redeemable_objectstring

Type of the redeemable.

customer_idstring

Unique identifier of the customer.

holder_rolestring

Role of the holder.

One ofOWNERREFERRERREFEREE

campaign_idstring

Unique identifier of the campaign as assigned by Voucherify.

campaign_typestring

Defines the type of the campaign.

One ofREFERRAL_PROGRAMDefault "REFERRAL_PROGRAM"

voucher_typestring

Defines the type of the voucher.

One ofGIFT_VOUCHERDISCOUNT_VOUCHERLOYALTY_CARD

metadataobject

A set of custom key/value pairs that you can attach to a redeemable holder. The metadata object stores all custom attributes assigned to the `redeemable_holder` object.

objectstring

The type of the object represented by JSON.

One ofredeemable_holderDefault "redeemable_holder"

json
{
  "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",
      "metadata": {},
      "object": "redeemable_holder"
    }
  ]
}

Need more? See the Voucherify guide for connection setup and behaviour shared by every action.