Class: VoucherifySdk::LoyaltiesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LoyaltiesApi

Returns a new instance of LoyaltiesApi.



19
20
21
# File 'lib/VoucherifySdk/api/loyalties_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/loyalties_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_member(campaign_id, opts = {}) ⇒ LoyaltiesMembersCreateResponseBody

Add Member This method assigns a loyalty card to a customer. It selects a loyalty card suitable for publication, adds a publish entry, and returns the published voucher. A voucher is suitable for publication when its active and hasnt been published yet. 📘 Auto-update campaign In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use auto-update campaign.

Parameters:

  • campaign_id (String)

    Unique campaign ID of the loyalty program.

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

    the optional parameters

Options Hash (opts):

  • :loyalties_members_create_request_body (LoyaltiesMembersCreateRequestBody)

    Provide details to whom the loyalty card should be assigned. You can choose to either specify the exact loyalty card code that you want to publish from existin (non-assigned) codes, or choose not to specify a voucher code. If you choose not to specify a code in the request paylaod, then the system will choose the next available voucher code available to be assigned to a customer. You can also include metadata in the request payload. This metadata will be assigned to the publication object, but will not be returned in the response to this endpoint. To see of publications (assignments of particular codes to customers) and publication metadata, use the List Publications endpoint.

Returns:



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

def add_member(campaign_id, opts = {})
  data, _status_code, _headers = add_member_with_http_info(campaign_id, opts)
  data
end

#create_earning_rule(campaign_id, opts = {}) ⇒ Array<LoyaltiesEarningRulesCreateResponseBody>

Create Earning Rule Create earning rules for a loyalty campaign.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

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

    the optional parameters

Options Hash (opts):

  • :loyalties_earning_rules_create_request_body_item (Array<LoyaltiesEarningRulesCreateRequestBodyItem>)

    Customize the request body based on the type of earning rules you would like to create. The request body is an array of objects. The required minimum properties to include in the payload for each object are event and loyalty. Additionally, if you choose to add a validity_timeframe, you must include a start_date. Furthermore, an earning rule event type: - customer.segment.entered requires a segment object - a custom event requires a custom_event object - a customer.loyalty.tier.joined, customer.loyalty.tier.left, customer.loyalty.tier.upgraded, customer.loyalty.tier.downgraded, customer.loyalty.tier.prolonged requires a loyalty_tier object

Returns:



94
95
96
97
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 94

def create_earning_rule(campaign_id, opts = {})
  data, _status_code, _headers = create_earning_rule_with_http_info(campaign_id, opts)
  data
end

#create_in_bulk_loyalty_tiers(campaign_id, opts = {}) ⇒ Array<LoyaltyTier>

Create loyalty tiers Creates loyalty tiers for desired campaign.

Parameters:

  • campaign_id (String)

    Unique loyalty campaign ID or name.

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

    the optional parameters

Options Hash (opts):

Returns:



160
161
162
163
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 160

def create_in_bulk_loyalty_tiers(campaign_id, opts = {})
  data, _status_code, _headers = create_in_bulk_loyalty_tiers_with_http_info(campaign_id, opts)
  data
end

#create_loyalty_program(opts = {}) ⇒ LoyaltiesCreateCampaignResponseBody

Create Loyalty Campaign Creates a batch of loyalty cards aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern. 📘 Global uniqueness All codes are unique across the whole project. Voucherify wont allow to generate the same codes in any of your campaigns. 🚧 Asyncronous action! This is an asynchronous action, you cant read or modify a newly created campaign until the code generation is completed. See creation_status field in the loyalty campaign object description.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



225
226
227
228
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 225

def create_loyalty_program(opts = {})
  data, _status_code, _headers = create_loyalty_program_with_http_info(opts)
  data
end

#create_points_expiration_export(campaign_id, opts = {}) ⇒ LoyaltiesPointsExpirationExportCreateResponseBody

Create Points Expiration Export Schedule the generation of a points expiration CSV file for a particular campaign.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name.

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

    the optional parameters

Options Hash (opts):

Returns:



290
291
292
293
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 290

def create_points_expiration_export(campaign_id, opts = {})
  data, _status_code, _headers = create_points_expiration_export_with_http_info(campaign_id, opts)
  data
end

#create_reward_assignment1(campaign_id, opts = {}) ⇒ LoyaltiesRewardsCreateAssignmentResponseBody

Create Reward Assignment Add rewards to a loyalty campaign.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

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

    the optional parameters

Options Hash (opts):

Returns:



356
357
358
359
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 356

def create_reward_assignment1(campaign_id, opts = {})
  data, _status_code, _headers = create_reward_assignment1_with_http_info(campaign_id, opts)
  data
end

#delete_earning_rule(campaign_id, earning_rule_id, opts = {}) ⇒ nil

Delete Earning Rule This method deletes an earning rule for a specific loyalty campaign.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • earning_rule_id (String)

    A unique earning rule ID.

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

    the optional parameters

Returns:

  • (nil)


422
423
424
425
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 422

def delete_earning_rule(campaign_id, earning_rule_id, opts = {})
  delete_earning_rule_with_http_info(campaign_id, earning_rule_id, opts)
  nil
end

#delete_loyalty_program(campaign_id, opts = {}) ⇒ LoyaltiesDeleteResponseBody

Delete Loyalty Campaign Deletes a loyalty campaign and all related loyalty cards. This action cannot be undone. Also, it immediately removes any redemptions on loyalty cards. If the force parameter is set to false or not set at all, the loyalty campaign and all related loyalty cards will be moved to the bin.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

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

    the optional parameters

Options Hash (opts):

  • :force (Boolean)

    If this flag is set to true, the campaign and related vouchers will be removed permanently. If it is set to false or not set at all, the loyalty campaign and all related loyalty cards will be moved to the bin. Going forward, the user will be able to create the next campaign with the same name.

Returns:



481
482
483
484
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 481

def delete_loyalty_program(campaign_id, opts = {})
  data, _status_code, _headers = delete_loyalty_program_with_http_info(campaign_id, opts)
  data
end

#delete_reward_assignment1(campaign_id, assignment_id, opts = {}) ⇒ nil

Delete Reward Assignment This method deletes a reward assignment for a particular loyalty campaign.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • assignment_id (String)

    A unique reward assignment ID.

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

    the optional parameters

Returns:

  • (nil)


543
544
545
546
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 543

def delete_reward_assignment1(campaign_id, assignment_id, opts = {})
  delete_reward_assignment1_with_http_info(campaign_id, assignment_id, opts)
  nil
end

#disable_earning_rule(campaign_id, earning_rule_id, opts = {}) ⇒ LoyaltiesEarningRulesDisableResponseBody

Disable Earning Rule Disable an earning rule.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name.

  • earning_rule_id (String)

    Unique earning rule ID.

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

    the optional parameters

Returns:



602
603
604
605
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 602

def disable_earning_rule(campaign_id, earning_rule_id, opts = {})
  data, _status_code, _headers = disable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts)
  data
end

#enable_earning_rule(campaign_id, earning_rule_id, opts = {}) ⇒ LoyaltiesEarningRulesEnableResponseBody

Enable Earning Rule Enable an earning rule.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name.

  • earning_rule_id (String)

    Unique earning rule ID.

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

    the optional parameters

Returns:



663
664
665
666
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 663

def enable_earning_rule(campaign_id, earning_rule_id, opts = {})
  data, _status_code, _headers = enable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts)
  data
end

#export_loyalty_card_transactions(member_id, opts = {}) ⇒ LoyaltiesMembersTransactionsExportCreateResponseBody

Export Loyalty Card Transactions Export transactions that are associated with point movements on a loyalty card.

Parameters:

  • member_id (String)

    A unique code identifying the loyalty card that you are looking to export transaction data for.

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

    the optional parameters

Options Hash (opts):

Returns:



724
725
726
727
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 724

def export_loyalty_card_transactions(member_id, opts = {})
  data, _status_code, _headers = export_loyalty_card_transactions_with_http_info(member_id, opts)
  data
end

#export_loyalty_card_transactions1(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersTransactionsExportCreateResponseBody

Export Loyalty Card Transactions Export transactions that are associated with point movements on a loyalty card.

Parameters:

  • campaign_id (String)

    A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export.

  • member_id (String)

    A unique code identifying the loyalty card that you are looking to export transaction data for.

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

    the optional parameters

Options Hash (opts):

Returns:



791
792
793
794
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 791

def export_loyalty_card_transactions1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = export_loyalty_card_transactions1_with_http_info(campaign_id, member_id, opts)
  data
end

#get_earning_rule(campaign_id, earning_rule_id, opts = {}) ⇒ LoyaltiesEarningRulesGetResponseBody

Get Earning Rule Retrieves an earning rule assigned to a campaign.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • earning_rule_id (String)

    A unique earning rule ID.

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

    the optional parameters

Returns:



858
859
860
861
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 858

def get_earning_rule(campaign_id, earning_rule_id, opts = {})
  data, _status_code, _headers = get_earning_rule_with_http_info(campaign_id, earning_rule_id, opts)
  data
end

#get_loyalty_program(campaign_id, opts = {}) ⇒ LoyaltiesGetCampaignResponseBody

Get Loyalty Campaign Retrieve a specific loyalty campaign.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

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

    the optional parameters

Returns:



918
919
920
921
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 918

def get_loyalty_program(campaign_id, opts = {})
  data, _status_code, _headers = get_loyalty_program_with_http_info(campaign_id, opts)
  data
end

#get_loyalty_tier(campaign_id, loyalty_tier_id, opts = {}) ⇒ LoyaltiesTiersGetResponseBody

Get Loyalty Tier Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID.

Parameters:

  • campaign_id (String)

    Unique loyalty campaign ID or name.

  • loyalty_tier_id (String)

    Unique loyalty tier ID.

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

    the optional parameters

Returns:



978
979
980
981
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 978

def get_loyalty_tier(campaign_id, loyalty_tier_id, opts = {})
  data, _status_code, _headers = get_loyalty_tier_with_http_info(campaign_id, loyalty_tier_id, opts)
  data
end

#get_member(member_id, opts = {}) ⇒ LoyaltiesMembersGetResponseBody

Get Member Retrieve loyalty card with the given member ID (i.e. voucher code). 📘 Alternative endpoint This endpoint is an alternative to this endpoint. The URL was re-designed to allow you to retrieve loyalty card details without having to provide the campaignId as a path parameter.

Parameters:

  • member_id (String)

    Unique loyalty card code assigned to a particular customer.

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

    the optional parameters

Returns:



1038
1039
1040
1041
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1038

def get_member(member_id, opts = {})
  data, _status_code, _headers = get_member_with_http_info(member_id, opts)
  data
end

#get_member1(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersGetResponseBody

Get Member Retrieves the loyalty card with the given member ID (i.e. voucher code).

Parameters:

  • campaign_id (String)

    Unique campaign ID.

  • member_id (String)

    Unique code that identifies the loyalty card.

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

    the optional parameters

Returns:



1098
1099
1100
1101
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1098

def get_member1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = get_member1_with_http_info(campaign_id, member_id, opts)
  data
end

#get_reward_assignment1(campaign_id, assignment_id, opts = {}) ⇒ LoyaltiesRewardAssignmentsGetResponseBody

Get Reward Assignment Retrieve specific reward assignment.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • assignment_id (String)

    Unique reward assignment ID.

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

    the optional parameters

Returns:



1159
1160
1161
1162
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1159

def get_reward_assignment1(campaign_id, assignment_id, opts = {})
  data, _status_code, _headers = get_reward_assignment1_with_http_info(campaign_id, assignment_id, opts)
  data
end

#get_reward_assignment2(campaign_id, assignment_id, opts = {}) ⇒ LoyaltiesRewardsGetResponseBody

Get Reward Assignment Retrieve specific reward assignment. 📘 Alternative endpoint This endpoint is an alternative to this endpoint.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • assignment_id (String)

    A unique reward assignment ID.

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

    the optional parameters

Returns:



1220
1221
1222
1223
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1220

def get_reward_assignment2(campaign_id, assignment_id, opts = {})
  data, _status_code, _headers = get_reward_assignment2_with_http_info(campaign_id, assignment_id, opts)
  data
end

#get_reward_details(campaign_id, assignment_id, opts = {}) ⇒ LoyaltiesRewardAssignmentsRewardGetResponseBody

Get Reward Details Get reward details in the context of a loyalty campaign and reward assignment ID.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • assignment_id (String)

    Unique reward assignment ID.

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

    the optional parameters

Returns:



1281
1282
1283
1284
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1281

def get_reward_details(campaign_id, assignment_id, opts = {})
  data, _status_code, _headers = get_reward_details_with_http_info(campaign_id, assignment_id, opts)
  data
end

#list_earning_rules(campaign_id, opts = {}) ⇒ LoyaltiesEarningRulesListResponseBody

List Earning Rules Returns a list of all earning rules within a given campaign.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListEarningRules)

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

Returns:



1344
1345
1346
1347
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1344

def list_earning_rules(campaign_id, opts = {})
  data, _status_code, _headers = list_earning_rules_with_http_info(campaign_id, opts)
  data
end

#list_loyalty_card_transactions(member_id, opts = {}) ⇒ LoyaltiesMembersTransactionsListResponseBody

List Loyalty Card Transactions Retrieve transaction data related to point movements for a specific loyalty card.

Parameters:

  • member_id (String)

    A unique code identifying the loyalty card that you are looking to retrieve transaction data for.

  • 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 (ParameterOrderListTransactions)

    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 transactions starting after a transaction with the given ID.

Returns:



1412
1413
1414
1415
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1412

def list_loyalty_card_transactions(member_id, opts = {})
  data, _status_code, _headers = list_loyalty_card_transactions_with_http_info(member_id, opts)
  data
end

#list_loyalty_card_transactions1(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersTransactionsListResponseBody

List Loyalty Card Transactions Retrieve transaction data related to point movements for a specific loyalty card.

Parameters:

  • campaign_id (String)

    A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return.

  • member_id (String)

    A unique code identifying the loyalty card that you are looking to retrieve transaction data for.

  • 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 (ParameterOrderListTransactions)

    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 transactions starting after a transaction with the given ID.

Returns:



1481
1482
1483
1484
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1481

def list_loyalty_card_transactions1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = list_loyalty_card_transactions1_with_http_info(campaign_id, member_id, opts)
  data
end

#list_loyalty_programs(opts = {}) ⇒ LoyaltiesListCampaignsResponseBody

List Loyalty Campaigns Returns a list of your loyalty campaigns.

Parameters:

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListCampaigns)

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

Returns:



1549
1550
1551
1552
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1549

def list_loyalty_programs(opts = {})
  data, _status_code, _headers = list_loyalty_programs_with_http_info(opts)
  data
end

#list_loyalty_tier_earning_rules(campaign_id, loyalty_tier_id, opts = {}) ⇒ LoyaltiesTiersEarningRulesListResponseBody

List Loyalty Tier Earning Rules Retrieve available earning rules for a given tier and the calculation method for earning points.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name.

  • loyalty_tier_id (String)

    Unique loyalty tier ID.

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

Returns:



1616
1617
1618
1619
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1616

def list_loyalty_tier_earning_rules(campaign_id, loyalty_tier_id, opts = {})
  data, _status_code, _headers = list_loyalty_tier_earning_rules_with_http_info(campaign_id, loyalty_tier_id, opts)
  data
end

#list_loyalty_tier_rewards(campaign_id, loyalty_tier_id, opts = {}) ⇒ LoyaltiesTiersRewardsListResponseBody

List Loyalty Tier Rewards Get available rewards for a given tier.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name.

  • loyalty_tier_id (String)

    Unique loyalty tier ID.

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

    the optional parameters

Returns:



1681
1682
1683
1684
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1681

def list_loyalty_tier_rewards(campaign_id, loyalty_tier_id, opts = {})
  data, _status_code, _headers = list_loyalty_tier_rewards_with_http_info(campaign_id, loyalty_tier_id, opts)
  data
end

#list_loyalty_tiers(campaign_id, opts = {}) ⇒ LoyaltiesTiersListResponseBody

List Loyalty Tiers Retrieve a list of loyalty tiers which were added to the loyalty program.

Parameters:

  • campaign_id (String)

    Unique loyalty campaign ID or name.

  • 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 (ParameterOrderListLoyaltyTiers)

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

Returns:



1743
1744
1745
1746
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1743

def list_loyalty_tiers(campaign_id, opts = {})
  data, _status_code, _headers = list_loyalty_tiers_with_http_info(campaign_id, opts)
  data
end

#list_member_activity(member_id, opts = {}) ⇒ LoyaltiesMemberActivityListResponseBody

List Member Activity

Parameters:

  • member_id (String)

    Unique loyalty card assigned to a particular customer.

  • 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 (ParameterOrderCreatedAt)

    Apply this filter to order the events according the date and time when it was created. 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.

Returns:



1809
1810
1811
1812
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1809

def list_member_activity(member_id, opts = {})
  data, _status_code, _headers = list_member_activity_with_http_info(member_id, opts)
  data
end

#list_member_activity1(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMemberActivityListResponseBody

List Member Activity Retrieves the list of activities for the given member ID related to a voucher and customer who is the holder of the voucher.

Parameters:

  • campaign_id (String)

    Unique campaign ID.

  • member_id (String)

    A code that identifies the loyalty card.

  • 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 (ParameterOrderCreatedAt)

    Apply this filter to order the events according the date and time when it was created. 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.

Returns:



1878
1879
1880
1881
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1878

def list_member_activity1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = list_member_activity1_with_http_info(campaign_id, member_id, opts)
  data
end

#list_member_loyalty_tier(member_id, opts = {}) ⇒ LoyaltiesMembersTiersListResponseBody

List Member’s Loyalty Tiers Retrieve member tiers using the loyalty card ID.

Parameters:

  • member_id (String)

    Unique loyalty card assigned to a particular customer.

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

    the optional parameters

Returns:



1944
1945
1946
1947
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 1944

def list_member_loyalty_tier(member_id, opts = {})
  data, _status_code, _headers = list_member_loyalty_tier_with_http_info(member_id, opts)
  data
end

#list_member_rewards(member_id, opts = {}) ⇒ LoyaltiesMembersRewardsListResponseBody

List Member Rewards Retrieves the list of rewards that the given customer (identified by member_id, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**. You can use the affordable_only parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Please note that rewards that are disabled (i.e. set to Not Available in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint.

Parameters:

  • member_id (String)

    Unique loyalty card assigned to a particular customer.

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

    the optional parameters

Options Hash (opts):

  • :affordable_only (Boolean)

    Limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Set this flag to true to return rewards which the customer can actually afford.

Returns:



2004
2005
2006
2007
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2004

def list_member_rewards(member_id, opts = {})
  data, _status_code, _headers = list_member_rewards_with_http_info(member_id, opts)
  data
end

#list_members(campaign_id, opts = {}) ⇒ LoyaltiesListMembersResponseBody

List Members Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.

Parameters:

  • campaign_id (String)

    Unique campaign ID of the loyalty program.

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :customer (String)

    A tracking identifier of a customer who is the holder of the vouchers. It can be an id generated by Voucherify or the source_id. Remember to use the proper URL escape codes if the source_id contains special characters.

  • :created_at (ParameterCreatedBeforeAfter)

    A filter on the list based on the object created_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [created_at] 2017-09-08T13:52:18.227Z

  • :updated_at (ParameterUpdatedBeforeAfter)

    A filter on the list based on the object updated_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [updated_at] 2017-09-08T13:52:18.227Z

  • :order (ParameterOrderVouchers)

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

  • :code (String)
  • :ids (Array<String>)

Returns:



2073
2074
2075
2076
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2073

def list_members(campaign_id, opts = {})
  data, _status_code, _headers = list_members_with_http_info(campaign_id, opts)
  data
end

#list_points_expiration(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersPointsExpirationListResponseBody

Get Points Expiration Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the Exports API to retrieve a list of both ACTIVE and EXPIRED point buckets.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • member_id (String)

    Loyalty card code.

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

Returns:



2151
2152
2153
2154
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2151

def list_points_expiration(campaign_id, member_id, opts = {})
  data, _status_code, _headers = list_points_expiration_with_http_info(campaign_id, member_id, opts)
  data
end

#list_reward_assignments1(campaign_id, opts = {}) ⇒ LoyaltiesRewardAssignmentsListResponseBody

List Reward Assignments Returns reward assignments from a given loyalty campaign. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. The URL was re-designed to be more contextual to the type of data returned in the response.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :assignment_id (String)

    A unique reward assignment ID.

Returns:



2218
2219
2220
2221
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2218

def list_reward_assignments1(campaign_id, opts = {})
  data, _status_code, _headers = list_reward_assignments1_with_http_info(campaign_id, opts)
  data
end

#list_reward_assignments2(campaign_id, opts = {}) ⇒ LoyaltiesRewardsListAssignmentsResponseBody

List Reward Assignments Returns active rewards from a given loyalty campaign.

Parameters:

  • campaign_id (String)

    Unique campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • 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.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :assignment_id (String)

    A unique reward assignment ID.

Returns:



2286
2287
2288
2289
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2286

def list_reward_assignments2(campaign_id, opts = {})
  data, _status_code, _headers = list_reward_assignments2_with_http_info(campaign_id, opts)
  data
end

#redeem_reward(member_id, opts = {}) ⇒ LoyaltiesMembersRedemptionRedeemResponseBody

Redeem Reward

Parameters:

  • member_id (String)

    Unique loyalty card assigned to a particular customer.

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

    the optional parameters

Options Hash (opts):

  • :loyalties_members_redemption_redeem_request_body (LoyaltiesMembersRedemptionRedeemRequestBody)

    Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.

Returns:



2352
2353
2354
2355
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2352

def redeem_reward(member_id, opts = {})
  data, _status_code, _headers = redeem_reward_with_http_info(member_id, opts)
  data
end

#redeem_reward1(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersRedemptionRedeemResponseBody

Redeem Reward Exchange points from a loyalty card for a specified reward. This API method returns an assigned award in the response. It means that if a requesting customer gets a coupon code with a discount for the next order, that discount code will be visible in response as part of the reward object definition.

Parameters:

  • campaign_id (String)

    Unique campaign ID.

  • member_id (String)

    A code that identifies the loyalty card.

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

    the optional parameters

Options Hash (opts):

  • :loyalties_members_redemption_redeem_request_body (LoyaltiesMembersRedemptionRedeemRequestBody)

    Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.

Returns:



2419
2420
2421
2422
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2419

def redeem_reward1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = redeem_reward1_with_http_info(campaign_id, member_id, opts)
  data
end

#transfer_points(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersTransfersCreateResponseBody

Transfer Loyalty Points Transfer points between different loyalty cards. You need to provide the campaign ID and the loyalty card ID you want the points to be transferred to as path parameters in the URL. In the request body, you provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.

Parameters:

  • campaign_id (String)

    A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination).

  • member_id (String)

    A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination).

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

    the optional parameters

Options Hash (opts):

  • :loyalties_transfer_points (Array<LoyaltiesTransferPoints>)

    Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.

Returns:



2487
2488
2489
2490
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2487

def transfer_points(campaign_id, member_id, opts = {})
  data, _status_code, _headers = transfer_points_with_http_info(campaign_id, member_id, opts)
  data
end

#update_earning_rule(campaign_id, earning_rule_id, opts = {}) ⇒ LoyaltiesEarningRulesUpdateResponseBody

Update Earning Rule Update an earning rule definition.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • earning_rule_id (String)

    A unique earning rule ID.

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

    the optional parameters

Options Hash (opts):

Returns:



2555
2556
2557
2558
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2555

def update_earning_rule(campaign_id, earning_rule_id, opts = {})
  data, _status_code, _headers = update_earning_rule_with_http_info(campaign_id, earning_rule_id, opts)
  data
end

#update_loyalty_card_balance(member_id, opts = {}) ⇒ LoyaltiesMembersBalanceUpdateResponseBody

Add or Remove Loyalty Card Balance This method gives adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest. >🚧 Async Action This is an async action. If you want to perform several add or remove loyalty card balance actions in a short time and their order matters, set up sufficient time-out between the calls. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. The URL was re-designed to allow you to add or remove loyalty card balance without having to provide the campaignId as a path parameter.

Parameters:

  • member_id (String)

    Unique loyalty card assigned to a particular customer.

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

    the optional parameters

Options Hash (opts):

Returns:



2622
2623
2624
2625
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2622

def update_loyalty_card_balance(member_id, opts = {})
  data, _status_code, _headers = update_loyalty_card_balance_with_http_info(member_id, opts)
  data
end

#update_loyalty_card_balance1(campaign_id, member_id, opts = {}) ⇒ LoyaltiesMembersBalanceUpdateResponseBody

Add or Remove Loyalty Card Balance This method adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest. >🚧 Async Action This is an async action. If you want to perform several add or remove loyalty card balance actions in a short time and their order matters, set up sufficient time-out between the calls.

Parameters:

  • campaign_id (String)

    Unique campaign ID.

  • member_id (String)

    A code that identifies the loyalty card.

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

    the optional parameters

Options Hash (opts):

Returns:



2689
2690
2691
2692
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2689

def update_loyalty_card_balance1(campaign_id, member_id, opts = {})
  data, _status_code, _headers = update_loyalty_card_balance1_with_http_info(campaign_id, member_id, opts)
  data
end

#update_loyalty_program(campaign_id, opts = {}) ⇒ LoyaltiesUpdateCampaignResponseBody

Update Loyalty Campaign Updates a loyalty program. Fields other than those specified in the allowed request body payload wont be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged. This method will update the loyalty cards which have not been published or redeemed yet.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

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

    the optional parameters

Options Hash (opts):

  • :loyalties_update_campaign_request_body (LoyaltiesUpdateCampaignRequestBody)

    Specify the new values for the parameters that you would like to update for the given loyalty campaign.

Returns:



2756
2757
2758
2759
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2756

def update_loyalty_program(campaign_id, opts = {})
  data, _status_code, _headers = update_loyalty_program_with_http_info(campaign_id, opts)
  data
end

#update_reward_assignment1(campaign_id, assignment_id, opts = {}) ⇒ LoyaltiesRewardsUpdateAssignmentResponseBody

Update Reward Assignment Updates rewards parameters, i.e. the points cost for the specific reward.

Parameters:

  • campaign_id (String)

    The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty%20Campaign.

  • assignment_id (String)

    A unique reward assignment ID.

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

    the optional parameters

Options Hash (opts):

Returns:



2823
2824
2825
2826
# File 'lib/VoucherifySdk/api/loyalties_api.rb', line 2823

def update_reward_assignment1(campaign_id, assignment_id, opts = {})
  data, _status_code, _headers = update_reward_assignment1_with_http_info(campaign_id, assignment_id, opts)
  data
end