Class: VoucherifySdk::ReferralsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/referrals_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReferralsApi

Returns a new instance of ReferralsApi.



19
20
21
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#referrals_add_holders(member_id, opts = {}) ⇒ ReferralsMembersHoldersCreateInBulkResponseBody

Add Referral Code Holders 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 referer, use the Create Publication endpoint. 📘 Alternative endpoint This endpoint is an alternative to the Add Referral Code Holders endpoint. The URL was re-designed to retrieve the referral member holders without providing the campaignId as a path paremeter.

Parameters:

  • member_id (String)

    Unique referral code or its identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 28

def referrals_add_holders(member_id, opts = {})
  data, _status_code, _headers = referrals_add_holders_with_http_info(member_id, opts)
  data
end

#referrals_add_holders1(campaign_id, member_id, opts = {}) ⇒ ReferralsMembersHoldersCreateInBulkResponseBody

Add Referral Code Holders 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 referer, use the Create Publication endpoint.

Parameters:

  • campaign_id (String)

    Unique identifier of a referral program campaign.

  • member_id (String)

    Unique referral code or its identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



95
96
97
98
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 95

def referrals_add_holders1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = referrals_add_holders1_with_http_info(campaign_id, member_id, opts)
  data
end

#referrals_code_holders(campaign_id, member_id, opts = {}) ⇒ ReferralsMembersHoldersListResponseBody

List Referral Code Holders Retrieves all the redeemables that have been assigned to the customer. To use this endpoint, you must have the following permissions: - Read Customers (customers.details.read)

Parameters:

  • campaign_id (String)

    Unique identifier of a referral program campaign.

  • member_id (String)

    Unique referral code or its identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :order (ParameterOrderListRedeemables)

    Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

  • :starting_after_id (String)

    A cursor for pagination. It retrieves the events starting after an event with the given ID.

  • :filters (ParameterFiltersListReferralsRedeemableHolders)

    Filters for listing customer redeemables.

Returns:



166
167
168
169
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 166

def referrals_code_holders(campaign_id, member_id, opts = {})
  data, _status_code, _headers = referrals_code_holders_with_http_info(campaign_id, member_id, opts)
  data
end

#referrals_code_holders1(member_id, opts = {}) ⇒ ReferralsMembersHoldersListResponseBody

List Referral Code Holders Retrieves the holders of the referral code from a referral campaign. To use this endpoint, you must have the following permissions: - Read Customers (customers.details.read) 📘 Alternative endpoint This endpoint is an alternative to the List Member Holders endpoint. The URL was re-designed to retrieve the referral member holders without providing the campaignId as a path paremeter.

Parameters:

  • member_id (String)

    Unique referral code or its identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :order (ParameterOrderListRedeemables)

    Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

  • :starting_after_id (String)

    A cursor for pagination. It retrieves the events starting after an event with the given ID.

  • :filters (ParameterFiltersListReferralsRedeemableHolders)

    Filters for listing customer redeemables.

Returns:



238
239
240
241
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 238

def referrals_code_holders1(member_id, opts = {})
  data, _status_code, _headers = referrals_code_holders1_with_http_info(member_id, opts)
  data
end

#referrals_remove_holder(member_id, holder_id, opts = {}) ⇒ nil

Remove Referral Card Holder Removes the holder from a referral card. You can remove a referee only. To use this endpoint, you must have the following permissions: - Create and modify Customers and Segments (customers.modify) - Publish Voucher (vouchers.publish) 📘 Alternative endpoint This endpoint is an alternative to the Remove Referral Card Holder endpoint. The URL was re-designed to retrieve the referral member holders without providing the campaignId as a path paremeter.

Parameters:

  • member_id (String)

    Unique referral code or its identifier.

  • holder_id (String)

    Unique identifier of a redeemable holder.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


306
307
308
309
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 306

def referrals_remove_holder(member_id, holder_id, opts = {})
  referrals_remove_holder_with_http_info(member_id, holder_id, opts)
  nil
end

#referrals_remove_holder1(campaign_id, member_id, holder_id, opts = {}) ⇒ nil

Remove Referral Card Holder Removes the holder from a referral card. You can remove a referee only. To use this endpoint, you must have the following permissions: - Create and modify Customers and Segments (customers.modify) - Publish Voucher (vouchers.publish)

Parameters:

  • campaign_id (String)

    Unique identifier of a referral program campaign.

  • member_id (String)

    Unique referral code or its identifier.

  • holder_id (String)

    Unique identifier of a redeemable holder.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


366
367
368
369
# File 'lib/VoucherifySdk/api/referrals_api.rb', line 366

def referrals_remove_holder1(campaign_id, member_id, holder_id, opts = {})
  referrals_remove_holder1_with_http_info(campaign_id, member_id, holder_id, opts)
  nil
end