class VoucherifySdk::LoyaltiesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/VoucherifySdk/api/loyalties_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

add_member(campaign_id, opts = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID of the loyalty program. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersCreateRequestBody] :loyalties_members_create_request_body 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. @return [LoyaltiesMembersCreateResponseBody]

# 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 = {}) click to toggle source

Create Earning Rule Create earning rules for a loyalty campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesEarningRulesCreateRequestBodyItem>] :loyalties_earning_rules_create_request_body_item 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 @return [Array<LoyaltiesEarningRulesCreateResponseBody>]

# 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 = {}) click to toggle source

Create loyalty tiers Creates loyalty tiers for desired campaign. @param campaign_id [String] Unique loyalty campaign ID or name. @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesTiersCreateInBulkRequestBodyItem>] :loyalties_tiers_create_in_bulk_request_body_item Provide tier definitions you want to add to existing loyalty campaign. @return [Array<LoyaltyTier>]

# 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 = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [LoyaltiesCreateCampaignRequestBody] :loyalties_create_campaign_request_body Specify the loyalty campaign details. @return [LoyaltiesCreateCampaignResponseBody]

# 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 = {}) click to toggle source

Create Points Expiration Export Schedule the generation of a points expiration CSV file for a particular campaign. @param campaign_id [String] Unique campaign ID or name. @param [Hash] opts the optional parameters @option opts [LoyaltiesPointsExpirationExportCreateRequestBody] :loyalties_points_expiration_export_create_request_body Specify the data filters, types of data to return and order in which the results should be returned. @return [LoyaltiesPointsExpirationExportCreateResponseBody]

# 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 = {}) click to toggle source

Create Reward Assignment Add rewards to a loyalty campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesRewardsCreateAssignmentItemRequestBody>] :loyalties_rewards_create_assignment_item_request_body Define the cost of the rewards in loyalty points. @return [LoyaltiesRewardsCreateAssignmentResponseBody]

# 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 = {}) click to toggle source

Delete Earning Rule This method deletes an earning rule for a specific loyalty campaign. @param 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. @param earning_rule_id [String] A unique earning rule ID. @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

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. @param 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. @param [Hash] opts the optional parameters @option opts [Boolean] :force 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. @return [LoyaltiesDeleteResponseBody]

# 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 = {}) click to toggle source

Delete Reward Assignment This method deletes a reward assignment for a particular loyalty campaign. @param 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. @param assignment_id [String] A unique reward assignment ID. @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

Disable Earning Rule Disable an earning rule. @param campaign_id [String] Unique campaign ID or name. @param earning_rule_id [String] Unique earning rule ID. @param [Hash] opts the optional parameters @return [LoyaltiesEarningRulesDisableResponseBody]

# 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 = {}) click to toggle source

Enable Earning Rule Enable an earning rule. @param campaign_id [String] Unique campaign ID or name. @param earning_rule_id [String] Unique earning rule ID. @param [Hash] opts the optional parameters @return [LoyaltiesEarningRulesEnableResponseBody]

# 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 = {}) click to toggle source

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

@param member_id [String] A unique code identifying the loyalty card that you are looking to export transaction data for. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersTransactionsExportCreateRequestBody] :loyalties_members_transactions_export_create_request_body Specify the parameters and filters for the transaction export. @return [LoyaltiesMembersTransactionsExportCreateResponseBody]

# 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 = {}) click to toggle source

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

@param campaign_id [String] A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export. @param member_id [String] A unique code identifying the loyalty card that you are looking to export transaction data for. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersTransactionsExportCreateRequestBody] :loyalties_members_transactions_export_create_request_body Specify the parameters and filters for the transaction export. @return [LoyaltiesMembersTransactionsExportCreateResponseBody]

# 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 = {}) click to toggle source

Get Earning Rule Retrieves an earning rule assigned to a campaign. @param 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. @param earning_rule_id [String] A unique earning rule ID. @param [Hash] opts the optional parameters @return [LoyaltiesEarningRulesGetResponseBody]

# 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 = {}) click to toggle source

Get Loyalty Campaign Retrieve a specific loyalty campaign. @param 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. @param [Hash] opts the optional parameters @return [LoyaltiesGetCampaignResponseBody]

# 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 = {}) click to toggle source

Get Loyalty Tier Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID. @param campaign_id [String] Unique loyalty campaign ID or name. @param loyalty_tier_id [String] Unique loyalty tier ID. @param [Hash] opts the optional parameters @return [LoyaltiesTiersGetResponseBody]

# 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 = {}) click to toggle source

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. @param member_id [String] Unique loyalty card code assigned to a particular customer. @param [Hash] opts the optional parameters @return [LoyaltiesMembersGetResponseBody]

# 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 = {}) click to toggle source

Get Member Retrieves the loyalty card with the given member ID (i.e. voucher code). @param campaign_id [String] Unique campaign ID. @param member_id [String] Unique code that identifies the loyalty card. @param [Hash] opts the optional parameters @return [LoyaltiesMembersGetResponseBody]

# 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 = {}) click to toggle source

Get Reward Assignment Retrieve specific reward assignment. @param 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. @param assignment_id [String] Unique reward assignment ID. @param [Hash] opts the optional parameters @return [LoyaltiesRewardAssignmentsGetResponseBody]

# 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 = {}) click to toggle source

Get Reward Assignment Retrieve specific reward assignment. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. @param 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. @param assignment_id [String] A unique reward assignment ID. @param [Hash] opts the optional parameters @return [LoyaltiesRewardsGetResponseBody]

# 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 = {}) click to toggle source

Get Reward Details Get reward details in the context of a loyalty campaign and reward assignment ID. @param 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. @param assignment_id [String] Unique reward assignment ID. @param [Hash] opts the optional parameters @return [LoyaltiesRewardAssignmentsRewardGetResponseBody]

# 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 = {}) click to toggle source

List Earning Rules Returns a list of all earning rules within a given campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [ParameterOrderListEarningRules] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @return [LoyaltiesEarningRulesListResponseBody]

# 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 = {}) click to toggle source

List Loyalty Card Transactions Retrieve transaction data related to point movements for a specific loyalty card. @param member_id [String] A unique code identifying the loyalty card that you are looking to retrieve transaction data for. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderListTransactions] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. @return [LoyaltiesMembersTransactionsListResponseBody]

# 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 = {}) click to toggle source

List Loyalty Card Transactions Retrieve transaction data related to point movements for a specific loyalty card. @param campaign_id [String] A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return. @param member_id [String] A unique code identifying the loyalty card that you are looking to retrieve transaction data for. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderListTransactions] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. @return [LoyaltiesMembersTransactionsListResponseBody]

# 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 = {}) click to toggle source

List Loyalty Campaigns Returns a list of your loyalty campaigns. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [ParameterOrderListCampaigns] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @return [LoyaltiesListCampaignsResponseBody]

# 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 = {}) click to toggle source

List Loyalty Tier Earning Rules Retrieve available earning rules for a given tier and the calculation method for earning points. @param campaign_id [String] Unique campaign ID or name. @param loyalty_tier_id [String] Unique loyalty tier ID. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @return [LoyaltiesTiersEarningRulesListResponseBody]

# 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 = {}) click to toggle source

List Loyalty Tier Rewards Get available rewards for a given tier. @param campaign_id [String] Unique campaign ID or name. @param loyalty_tier_id [String] Unique loyalty tier ID. @param [Hash] opts the optional parameters @return [LoyaltiesTiersRewardsListResponseBody]

# 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 = {}) click to toggle source

List Loyalty Tiers Retrieve a list of loyalty tiers which were added to the loyalty program. @param campaign_id [String] Unique loyalty campaign ID or name. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderListLoyaltyTiers] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @return [LoyaltiesTiersListResponseBody]

# 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 = {}) click to toggle source

List Member Activity

📘 Alternative endpoint  This endpoint is an alternative to this endpoint. The URL was re-designed to allow you to get member activities without having to provide the campaignId as a path parameter. Retrieves the list of activities for the given member ID related to a voucher and customer who is the holder of the voucher.

@param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderCreatedAt] :order 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. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the events starting after an event with the given ID. @return [LoyaltiesMemberActivityListResponseBody]

# 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 = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID. @param member_id [String] A code that identifies the loyalty card. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderCreatedAt] :order 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. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the events starting after an event with the given ID. @return [LoyaltiesMemberActivityListResponseBody]

# 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 = {}) click to toggle source

List Member’s Loyalty Tiers Retrieve member tiers using the loyalty card ID. @param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @return [LoyaltiesMembersTiersListResponseBody]

# 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 = {}) click to toggle source

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. @param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [Boolean] :affordable_only 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. @return [LoyaltiesMembersRewardsListResponseBody]

# 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 = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID of the loyalty program. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [String] :customer 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. @option opts [ParameterCreatedBeforeAfter] :created_at 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 @option opts [ParameterUpdatedBeforeAfter] :updated_at 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 @option opts [ParameterOrderVouchers] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @option opts [String] :code @option opts [Array<String>] :ids @return [LoyaltiesListMembersResponseBody]

# 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 = {}) click to toggle source

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. @param 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. @param member_id [String] Loyalty card code. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @return [LoyaltiesMembersPointsExpirationListResponseBody]

# 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 = {}) click to toggle source

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. @param 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. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [String] :assignment_id A unique reward assignment ID. @return [LoyaltiesRewardAssignmentsListResponseBody]

# 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 = {}) click to toggle source

List Reward Assignments Returns active rewards from a given loyalty campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [String] :assignment_id A unique reward assignment ID. @return [LoyaltiesRewardsListAssignmentsResponseBody]

# 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 = {}) click to toggle source

Redeem Reward

📘 Alternative endpoint  This endpoint is an alternative to this endpoint. The URL was re-designed to allow you to redeem a reward without having to provide the campaignId as a path parameter.

@param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersRedemptionRedeemRequestBody] :loyalties_members_redemption_redeem_request_body 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. @return [LoyaltiesMembersRedemptionRedeemResponseBody]

# 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 = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID. @param member_id [String] A code that identifies the loyalty card. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersRedemptionRedeemRequestBody] :loyalties_members_redemption_redeem_request_body 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. @return [LoyaltiesMembersRedemptionRedeemResponseBody]

# 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 = {}) click to toggle source

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. @param campaign_id [String] A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination). @param member_id [String] A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination). @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesTransferPoints>] :loyalties_transfer_points Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card. @return [LoyaltiesMembersTransfersCreateResponseBody]

# 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 = {}) click to toggle source

Update Earning Rule Update an earning rule definition. @param 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. @param earning_rule_id [String] A unique earning rule ID. @param [Hash] opts the optional parameters @option opts [LoyaltiesEarningRulesUpdateRequestBody] :loyalties_earning_rules_update_request_body Specify the parameters that you would like to update for the given earning rule. @return [LoyaltiesEarningRulesUpdateResponseBody]

# 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 = {}) click to toggle source

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. @param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersBalanceUpdateRequestBody] :loyalties_members_balance_update_request_body Specify the point adjustment along with the expiration mechanism. @return [LoyaltiesMembersBalanceUpdateResponseBody]

# 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 = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID. @param member_id [String] A code that identifies the loyalty card. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersBalanceUpdateRequestBody] :loyalties_members_balance_update_request_body Specify the point adjustment along with the expiration mechanism. @return [LoyaltiesMembersBalanceUpdateResponseBody]

# 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 = {}) click to toggle source

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. @param 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. @param [Hash] opts the optional parameters @option opts [LoyaltiesUpdateCampaignRequestBody] :loyalties_update_campaign_request_body Specify the new values for the parameters that you would like to update for the given loyalty campaign. @return [LoyaltiesUpdateCampaignResponseBody]

# 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 = {}) click to toggle source

Update Reward Assignment Updates rewards parameters, i.e. the points cost for the specific reward. @param 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. @param assignment_id [String] A unique reward assignment ID. @param [Hash] opts the optional parameters @option opts [LoyaltiesRewardsUpdateAssignmentRequestBody] :loyalties_rewards_update_assignment_request_body Update the points cost for the reward assignment. @return [LoyaltiesRewardsUpdateAssignmentResponseBody]

# 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

Private Instance Methods

add_member_with_http_info(campaign_id, opts = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID of the loyalty program. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersCreateRequestBody] :loyalties_members_create_request_body 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. @return [Array<(LoyaltiesMembersCreateResponseBody, Integer, Hash)>] LoyaltiesMembersCreateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 39
        def add_member_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.add_member ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_create_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersCreateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.add_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#add_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_earning_rule_with_http_info(campaign_id, opts = {}) click to toggle source

Create Earning Rule Create earning rules for a loyalty campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesEarningRulesCreateRequestBodyItem>] :loyalties_earning_rules_create_request_body_item 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 @return [Array<(Array<LoyaltiesEarningRulesCreateResponseBody>, Integer, Hash)>] Array<LoyaltiesEarningRulesCreateResponseBody> data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 105
        def create_earning_rule_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.create_earning_rule ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_earning_rules_create_request_body_item'])

  # return_type
  return_type = opts[:debug_return_type] || 'Array<LoyaltiesEarningRulesCreateResponseBody>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.create_earning_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#create_earning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_in_bulk_loyalty_tiers_with_http_info(campaign_id, opts = {}) click to toggle source

Create loyalty tiers Creates loyalty tiers for desired campaign. @param campaign_id [String] Unique loyalty campaign ID or name. @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesTiersCreateInBulkRequestBodyItem>] :loyalties_tiers_create_in_bulk_request_body_item Provide tier definitions you want to add to existing loyalty campaign. @return [Array<(Array<LoyaltyTier>, Integer, Hash)>] Array<LoyaltyTier> data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 171
        def create_in_bulk_loyalty_tiers_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.create_in_bulk_loyalty_tiers ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/tiers'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_tiers_create_in_bulk_request_body_item'])

  # return_type
  return_type = opts[:debug_return_type] || 'Array<LoyaltyTier>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.create_in_bulk_loyalty_tiers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#create_in_bulk_loyalty_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_loyalty_program_with_http_info(opts = {}) click to toggle source

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. @param [Hash] opts the optional parameters @option opts [LoyaltiesCreateCampaignRequestBody] :loyalties_create_campaign_request_body Specify the loyalty campaign details. @return [Array<(LoyaltiesCreateCampaignResponseBody, Integer, Hash)>] LoyaltiesCreateCampaignResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 235
        def create_loyalty_program_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.create_loyalty_program ...'
  end
  # resource path
  local_var_path = '/v1/loyalties'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_create_campaign_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesCreateCampaignResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.create_loyalty_program",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#create_loyalty_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_points_expiration_export_with_http_info(campaign_id, opts = {}) click to toggle source

Create Points Expiration Export Schedule the generation of a points expiration CSV file for a particular campaign. @param campaign_id [String] Unique campaign ID or name. @param [Hash] opts the optional parameters @option opts [LoyaltiesPointsExpirationExportCreateRequestBody] :loyalties_points_expiration_export_create_request_body Specify the data filters, types of data to return and order in which the results should be returned. @return [Array<(LoyaltiesPointsExpirationExportCreateResponseBody, Integer, Hash)>] LoyaltiesPointsExpirationExportCreateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 301
        def create_points_expiration_export_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.create_points_expiration_export ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/points-expiration/export'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_points_expiration_export_create_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesPointsExpirationExportCreateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.create_points_expiration_export",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#create_points_expiration_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_reward_assignment1_with_http_info(campaign_id, opts = {}) click to toggle source

Create Reward Assignment Add rewards to a loyalty campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesRewardsCreateAssignmentItemRequestBody>] :loyalties_rewards_create_assignment_item_request_body Define the cost of the rewards in loyalty points. @return [Array<(LoyaltiesRewardsCreateAssignmentResponseBody, Integer, Hash)>] LoyaltiesRewardsCreateAssignmentResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 367
        def create_reward_assignment1_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.create_reward_assignment1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/rewards'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_rewards_create_assignment_item_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardsCreateAssignmentResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.create_reward_assignment1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#create_reward_assignment1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) click to toggle source

Delete Earning Rule This method deletes an earning rule for a specific loyalty campaign. @param 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. @param earning_rule_id [String] A unique earning rule ID. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 433
        def delete_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.delete_earning_rule ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'earningRuleId' + '}', CGI.escape(earning_rule_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.delete_earning_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#delete_earning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_loyalty_program_with_http_info(campaign_id, opts = {}) click to toggle source

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. @param 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. @param [Hash] opts the optional parameters @option opts [Boolean] :force 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. @return [Array<(LoyaltiesDeleteResponseBody, Integer, Hash)>] LoyaltiesDeleteResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 492
        def delete_loyalty_program_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.delete_loyalty_program ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesDeleteResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.delete_loyalty_program",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#delete_loyalty_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_reward_assignment1_with_http_info(campaign_id, assignment_id, opts = {}) click to toggle source

Delete Reward Assignment This method deletes a reward assignment for a particular loyalty campaign. @param 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. @param assignment_id [String] A unique reward assignment ID. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 554
        def delete_reward_assignment1_with_http_info(campaign_id, assignment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.delete_reward_assignment1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/rewards/{assignmentId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'assignmentId' + '}', CGI.escape(assignment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.delete_reward_assignment1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#delete_reward_assignment1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
disable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) click to toggle source

Disable Earning Rule Disable an earning rule. @param campaign_id [String] Unique campaign ID or name. @param earning_rule_id [String] Unique earning rule ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesEarningRulesDisableResponseBody, Integer, Hash)>] LoyaltiesEarningRulesDisableResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 613
        def disable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.disable_earning_rule ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'earningRuleId' + '}', CGI.escape(earning_rule_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesEarningRulesDisableResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.disable_earning_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#disable_earning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
enable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) click to toggle source

Enable Earning Rule Enable an earning rule. @param campaign_id [String] Unique campaign ID or name. @param earning_rule_id [String] Unique earning rule ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesEarningRulesEnableResponseBody, Integer, Hash)>] LoyaltiesEarningRulesEnableResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 674
        def enable_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.enable_earning_rule ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'earningRuleId' + '}', CGI.escape(earning_rule_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesEarningRulesEnableResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.enable_earning_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#enable_earning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
export_loyalty_card_transactions1_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

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

@param campaign_id [String] A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export. @param member_id [String] A unique code identifying the loyalty card that you are looking to export transaction data for. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersTransactionsExportCreateRequestBody] :loyalties_members_transactions_export_create_request_body Specify the parameters and filters for the transaction export. @return [Array<(LoyaltiesMembersTransactionsExportCreateResponseBody, Integer, Hash)>] LoyaltiesMembersTransactionsExportCreateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 803
        def export_loyalty_card_transactions1_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.export_loyalty_card_transactions1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/transactions/export'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_transactions_export_create_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersTransactionsExportCreateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.export_loyalty_card_transactions1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#export_loyalty_card_transactions1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
export_loyalty_card_transactions_with_http_info(member_id, opts = {}) click to toggle source

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

@param member_id [String] A unique code identifying the loyalty card that you are looking to export transaction data for. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersTransactionsExportCreateRequestBody] :loyalties_members_transactions_export_create_request_body Specify the parameters and filters for the transaction export. @return [Array<(LoyaltiesMembersTransactionsExportCreateResponseBody, Integer, Hash)>] LoyaltiesMembersTransactionsExportCreateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 735
        def export_loyalty_card_transactions_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.export_loyalty_card_transactions ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/transactions/export'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_transactions_export_create_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersTransactionsExportCreateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.export_loyalty_card_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#export_loyalty_card_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) click to toggle source

Get Earning Rule Retrieves an earning rule assigned to a campaign. @param 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. @param earning_rule_id [String] A unique earning rule ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesEarningRulesGetResponseBody, Integer, Hash)>] LoyaltiesEarningRulesGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 869
        def get_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_earning_rule ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'earningRuleId' + '}', CGI.escape(earning_rule_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesEarningRulesGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_earning_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_earning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_loyalty_program_with_http_info(campaign_id, opts = {}) click to toggle source

Get Loyalty Campaign Retrieve a specific loyalty campaign. @param 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. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesGetCampaignResponseBody, Integer, Hash)>] LoyaltiesGetCampaignResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 928
        def get_loyalty_program_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_loyalty_program ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesGetCampaignResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_loyalty_program",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_loyalty_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_loyalty_tier_with_http_info(campaign_id, loyalty_tier_id, opts = {}) click to toggle source

Get Loyalty Tier Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID. @param campaign_id [String] Unique loyalty campaign ID or name. @param loyalty_tier_id [String] Unique loyalty tier ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesTiersGetResponseBody, Integer, Hash)>] LoyaltiesTiersGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 989
        def get_loyalty_tier_with_http_info(campaign_id, loyalty_tier_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_loyalty_tier ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/tiers/{loyaltyTierId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'loyaltyTierId' + '}', CGI.escape(loyalty_tier_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesTiersGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_loyalty_tier",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_loyalty_tier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_member1_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

Get Member Retrieves the loyalty card with the given member ID (i.e. voucher code). @param campaign_id [String] Unique campaign ID. @param member_id [String] Unique code that identifies the loyalty card. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesMembersGetResponseBody, Integer, Hash)>] LoyaltiesMembersGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1109
        def get_member1_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_member1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_member1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_member1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_member_with_http_info(member_id, opts = {}) click to toggle source

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. @param member_id [String] Unique loyalty card code assigned to a particular customer. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesMembersGetResponseBody, Integer, Hash)>] LoyaltiesMembersGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1048
        def get_member_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_member ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_reward_assignment1_with_http_info(campaign_id, assignment_id, opts = {}) click to toggle source

Get Reward Assignment Retrieve specific reward assignment. @param 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. @param assignment_id [String] Unique reward assignment ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesRewardAssignmentsGetResponseBody, Integer, Hash)>] LoyaltiesRewardAssignmentsGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1170
        def get_reward_assignment1_with_http_info(campaign_id, assignment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_reward_assignment1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'assignmentId' + '}', CGI.escape(assignment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardAssignmentsGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_reward_assignment1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_reward_assignment1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_reward_assignment2_with_http_info(campaign_id, assignment_id, opts = {}) click to toggle source

Get Reward Assignment Retrieve specific reward assignment. 📘 Alternative endpoint This endpoint is an alternative to this endpoint. @param 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. @param assignment_id [String] A unique reward assignment ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesRewardsGetResponseBody, Integer, Hash)>] LoyaltiesRewardsGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1231
        def get_reward_assignment2_with_http_info(campaign_id, assignment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_reward_assignment2 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/rewards/{assignmentId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'assignmentId' + '}', CGI.escape(assignment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardsGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_reward_assignment2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_reward_assignment2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_reward_details_with_http_info(campaign_id, assignment_id, opts = {}) click to toggle source

Get Reward Details Get reward details in the context of a loyalty campaign and reward assignment ID. @param 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. @param assignment_id [String] Unique reward assignment ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesRewardAssignmentsRewardGetResponseBody, Integer, Hash)>] LoyaltiesRewardAssignmentsRewardGetResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1292
        def get_reward_details_with_http_info(campaign_id, assignment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.get_reward_details ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'assignmentId' + '}', CGI.escape(assignment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardAssignmentsRewardGetResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.get_reward_details",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#get_reward_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_earning_rules_with_http_info(campaign_id, opts = {}) click to toggle source

List Earning Rules Returns a list of all earning rules within a given campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [ParameterOrderListEarningRules] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @return [Array<(LoyaltiesEarningRulesListResponseBody, Integer, Hash)>] LoyaltiesEarningRulesListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1357
        def list_earning_rules_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_earning_rules ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesEarningRulesListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_earning_rules",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_earning_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_loyalty_card_transactions1_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

List Loyalty Card Transactions Retrieve transaction data related to point movements for a specific loyalty card. @param campaign_id [String] A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return. @param member_id [String] A unique code identifying the loyalty card that you are looking to retrieve transaction data for. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderListTransactions] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. @return [Array<(LoyaltiesMembersTransactionsListResponseBody, Integer, Hash)>] LoyaltiesMembersTransactionsListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1495
        def list_loyalty_card_transactions1_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_loyalty_card_transactions1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/transactions'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersTransactionsListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_loyalty_card_transactions1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_loyalty_card_transactions1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_loyalty_card_transactions_with_http_info(member_id, opts = {}) click to toggle source

List Loyalty Card Transactions Retrieve transaction data related to point movements for a specific loyalty card. @param member_id [String] A unique code identifying the loyalty card that you are looking to retrieve transaction data for. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderListTransactions] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. @return [Array<(LoyaltiesMembersTransactionsListResponseBody, Integer, Hash)>] LoyaltiesMembersTransactionsListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1425
        def list_loyalty_card_transactions_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_loyalty_card_transactions ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/transactions'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersTransactionsListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_loyalty_card_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_loyalty_card_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_loyalty_programs_with_http_info(opts = {}) click to toggle source

List Loyalty Campaigns Returns a list of your loyalty campaigns. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [ParameterOrderListCampaigns] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @return [Array<(LoyaltiesListCampaignsResponseBody, Integer, Hash)>] LoyaltiesListCampaignsResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1561
        def list_loyalty_programs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_loyalty_programs ...'
  end
  # resource path
  local_var_path = '/v1/loyalties'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesListCampaignsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_loyalty_programs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_loyalty_programs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_loyalty_tier_earning_rules_with_http_info(campaign_id, loyalty_tier_id, opts = {}) click to toggle source

List Loyalty Tier Earning Rules Retrieve available earning rules for a given tier and the calculation method for earning points. @param campaign_id [String] Unique campaign ID or name. @param loyalty_tier_id [String] Unique loyalty tier ID. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @return [Array<(LoyaltiesTiersEarningRulesListResponseBody, Integer, Hash)>] LoyaltiesTiersEarningRulesListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1629
        def list_loyalty_tier_earning_rules_with_http_info(campaign_id, loyalty_tier_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_loyalty_tier_earning_rules ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'loyaltyTierId' + '}', CGI.escape(loyalty_tier_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesTiersEarningRulesListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_loyalty_tier_earning_rules",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_loyalty_tier_earning_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_loyalty_tier_rewards_with_http_info(campaign_id, loyalty_tier_id, opts = {}) click to toggle source

List Loyalty Tier Rewards Get available rewards for a given tier. @param campaign_id [String] Unique campaign ID or name. @param loyalty_tier_id [String] Unique loyalty tier ID. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesTiersRewardsListResponseBody, Integer, Hash)>] LoyaltiesTiersRewardsListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1692
        def list_loyalty_tier_rewards_with_http_info(campaign_id, loyalty_tier_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_loyalty_tier_rewards ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/rewards'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'loyaltyTierId' + '}', CGI.escape(loyalty_tier_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesTiersRewardsListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_loyalty_tier_rewards",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_loyalty_tier_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_loyalty_tiers_with_http_info(campaign_id, opts = {}) click to toggle source

List Loyalty Tiers Retrieve a list of loyalty tiers which were added to the loyalty program. @param campaign_id [String] Unique loyalty campaign ID or name. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderListLoyaltyTiers] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @return [Array<(LoyaltiesTiersListResponseBody, Integer, Hash)>] LoyaltiesTiersListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1755
        def list_loyalty_tiers_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_loyalty_tiers ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/tiers'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesTiersListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_loyalty_tiers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_loyalty_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_member_activity1_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID. @param member_id [String] A code that identifies the loyalty card. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderCreatedAt] :order 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. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the events starting after an event with the given ID. @return [Array<(LoyaltiesMemberActivityListResponseBody, Integer, Hash)>] LoyaltiesMemberActivityListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1892
        def list_member_activity1_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_member_activity1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/activity'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMemberActivityListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_member_activity1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_member_activity1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_member_activity_with_http_info(member_id, opts = {}) click to toggle source

List Member Activity

📘 Alternative endpoint  This endpoint is an alternative to this endpoint. The URL was re-designed to allow you to get member activities without having to provide the campaignId as a path parameter. Retrieves the list of activities for the given member ID related to a voucher and customer who is the holder of the voucher.

@param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [ParameterOrderCreatedAt] :order 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. @option opts [String] :starting_after_id A cursor for pagination. It retrieves the events starting after an event with the given ID. @return [Array<(LoyaltiesMemberActivityListResponseBody, Integer, Hash)>] LoyaltiesMemberActivityListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1822
        def list_member_activity_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_member_activity ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/activity'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'starting_after_id'] = opts[:'starting_after_id'] if !opts[:'starting_after_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMemberActivityListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_member_activity",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_member_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_member_loyalty_tier_with_http_info(member_id, opts = {}) click to toggle source

List Member&#39;s Loyalty Tiers Retrieve member tiers using the loyalty card ID. @param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @return [Array<(LoyaltiesMembersTiersListResponseBody, Integer, Hash)>] LoyaltiesMembersTiersListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 1954
        def list_member_loyalty_tier_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_member_loyalty_tier ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/tiers'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersTiersListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_member_loyalty_tier",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_member_loyalty_tier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_member_rewards_with_http_info(member_id, opts = {}) click to toggle source

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. @param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [Boolean] :affordable_only 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. @return [Array<(LoyaltiesMembersRewardsListResponseBody, Integer, Hash)>] LoyaltiesMembersRewardsListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2015
        def list_member_rewards_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_member_rewards ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/rewards'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'affordable_only'] = opts[:'affordable_only'] if !opts[:'affordable_only'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersRewardsListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_member_rewards",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_member_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_members_with_http_info(campaign_id, opts = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID of the loyalty program. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [String] :customer 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. @option opts [ParameterCreatedBeforeAfter] :created_at 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 @option opts [ParameterUpdatedBeforeAfter] :updated_at 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 @option opts [ParameterOrderVouchers] :order Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. @option opts [String] :code @option opts [Array<String>] :ids @return [Array<(LoyaltiesListMembersResponseBody, Integer, Hash)>] LoyaltiesListMembersResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2091
        def list_members_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_members ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'customer'] = opts[:'customer'] if !opts[:'customer'].nil?
  query_params[:'created_at'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'updated_at'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil?
  query_params[:'ids'] = @api_client.build_collection_param(opts[:'ids'], :multi) if !opts[:'ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesListMembersResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_members",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_points_expiration_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

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. @param 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. @param member_id [String] Loyalty card code. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @return [Array<(LoyaltiesMembersPointsExpirationListResponseBody, Integer, Hash)>] LoyaltiesMembersPointsExpirationListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2164
        def list_points_expiration_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_points_expiration ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/points-expiration'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersPointsExpirationListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_points_expiration",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_points_expiration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_reward_assignments1_with_http_info(campaign_id, opts = {}) click to toggle source

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. @param 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. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [String] :assignment_id A unique reward assignment ID. @return [Array<(LoyaltiesRewardAssignmentsListResponseBody, Integer, Hash)>] LoyaltiesRewardAssignmentsListResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2231
        def list_reward_assignments1_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_reward_assignments1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/reward-assignments'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'assignmentId'] = opts[:'assignment_id'] if !opts[:'assignment_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardAssignmentsListResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_reward_assignments1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_reward_assignments1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_reward_assignments2_with_http_info(campaign_id, opts = {}) click to toggle source

List Reward Assignments Returns active rewards from a given loyalty campaign. @param 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. @param [Hash] opts the optional parameters @option opts [Integer] :limit 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. @option opts [Integer] :page Which page of results to return. The lowest value is 1. @option opts [String] :assignment_id A unique reward assignment ID. @return [Array<(LoyaltiesRewardsListAssignmentsResponseBody, Integer, Hash)>] LoyaltiesRewardsListAssignmentsResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2299
        def list_reward_assignments2_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.list_reward_assignments2 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/rewards'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'assignment_id'] = opts[:'assignment_id'] if !opts[:'assignment_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardsListAssignmentsResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.list_reward_assignments2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#list_reward_assignments2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
redeem_reward1_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

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. @param campaign_id [String] Unique campaign ID. @param member_id [String] A code that identifies the loyalty card. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersRedemptionRedeemRequestBody] :loyalties_members_redemption_redeem_request_body 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. @return [Array<(LoyaltiesMembersRedemptionRedeemResponseBody, Integer, Hash)>] LoyaltiesMembersRedemptionRedeemResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2431
        def redeem_reward1_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.redeem_reward1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/redemption'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_redemption_redeem_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersRedemptionRedeemResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.redeem_reward1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#redeem_reward1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
redeem_reward_with_http_info(member_id, opts = {}) click to toggle source

Redeem Reward

📘 Alternative endpoint  This endpoint is an alternative to this endpoint. The URL was re-designed to allow you to redeem a reward without having to provide the campaignId as a path parameter.

@param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersRedemptionRedeemRequestBody] :loyalties_members_redemption_redeem_request_body 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. @return [Array<(LoyaltiesMembersRedemptionRedeemResponseBody, Integer, Hash)>] LoyaltiesMembersRedemptionRedeemResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2363
        def redeem_reward_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.redeem_reward ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/redemption'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_redemption_redeem_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersRedemptionRedeemResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.redeem_reward",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#redeem_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
transfer_points_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

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. @param campaign_id [String] A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination). @param member_id [String] A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination). @param [Hash] opts the optional parameters @option opts [Array<LoyaltiesTransferPoints>] :loyalties_transfer_points Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card. @return [Array<(LoyaltiesMembersTransfersCreateResponseBody, Integer, Hash)>] LoyaltiesMembersTransfersCreateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2499
        def transfer_points_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.transfer_points ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/transfers'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_transfer_points'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersTransfersCreateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.transfer_points",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#transfer_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {}) click to toggle source

Update Earning Rule Update an earning rule definition. @param 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. @param earning_rule_id [String] A unique earning rule ID. @param [Hash] opts the optional parameters @option opts [LoyaltiesEarningRulesUpdateRequestBody] :loyalties_earning_rules_update_request_body Specify the parameters that you would like to update for the given earning rule. @return [Array<(LoyaltiesEarningRulesUpdateResponseBody, Integer, Hash)>] LoyaltiesEarningRulesUpdateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2567
        def update_earning_rule_with_http_info(campaign_id, earning_rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.update_earning_rule ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'earningRuleId' + '}', CGI.escape(earning_rule_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_earning_rules_update_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesEarningRulesUpdateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.update_earning_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#update_earning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_loyalty_card_balance1_with_http_info(campaign_id, member_id, opts = {}) click to toggle source

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. &gt;🚧 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. @param campaign_id [String] Unique campaign ID. @param member_id [String] A code that identifies the loyalty card. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersBalanceUpdateRequestBody] :loyalties_members_balance_update_request_body Specify the point adjustment along with the expiration mechanism. @return [Array<(LoyaltiesMembersBalanceUpdateResponseBody, Integer, Hash)>] LoyaltiesMembersBalanceUpdateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2701
        def update_loyalty_card_balance1_with_http_info(campaign_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.update_loyalty_card_balance1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/members/{memberId}/balance'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_balance_update_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersBalanceUpdateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.update_loyalty_card_balance1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#update_loyalty_card_balance1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_loyalty_card_balance_with_http_info(member_id, opts = {}) click to toggle source

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. &gt;🚧 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. @param member_id [String] Unique loyalty card assigned to a particular customer. @param [Hash] opts the optional parameters @option opts [LoyaltiesMembersBalanceUpdateRequestBody] :loyalties_members_balance_update_request_body Specify the point adjustment along with the expiration mechanism. @return [Array<(LoyaltiesMembersBalanceUpdateResponseBody, Integer, Hash)>] LoyaltiesMembersBalanceUpdateResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2633
        def update_loyalty_card_balance_with_http_info(member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.update_loyalty_card_balance ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/members/{memberId}/balance'.sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_members_balance_update_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesMembersBalanceUpdateResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.update_loyalty_card_balance",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#update_loyalty_card_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_loyalty_program_with_http_info(campaign_id, opts = {}) click to toggle source

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. @param 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. @param [Hash] opts the optional parameters @option opts [LoyaltiesUpdateCampaignRequestBody] :loyalties_update_campaign_request_body Specify the new values for the parameters that you would like to update for the given loyalty campaign. @return [Array<(LoyaltiesUpdateCampaignResponseBody, Integer, Hash)>] LoyaltiesUpdateCampaignResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2767
        def update_loyalty_program_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.update_loyalty_program ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_update_campaign_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesUpdateCampaignResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.update_loyalty_program",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#update_loyalty_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_reward_assignment1_with_http_info(campaign_id, assignment_id, opts = {}) click to toggle source

Update Reward Assignment Updates rewards parameters, i.e. the points cost for the specific reward. @param 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. @param assignment_id [String] A unique reward assignment ID. @param [Hash] opts the optional parameters @option opts [LoyaltiesRewardsUpdateAssignmentRequestBody] :loyalties_rewards_update_assignment_request_body Update the points cost for the reward assignment. @return [Array<(LoyaltiesRewardsUpdateAssignmentResponseBody, Integer, Hash)>] LoyaltiesRewardsUpdateAssignmentResponseBody data, response status code and response headers

# File lib/VoucherifySdk/api/loyalties_api.rb, line 2835
        def update_reward_assignment1_with_http_info(campaign_id, assignment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoyaltiesApi.update_reward_assignment1 ...'
  end
  # resource path
  local_var_path = '/v1/loyalties/{campaignId}/rewards/{assignmentId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'assignmentId' + '}', CGI.escape(assignment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'loyalties_rewards_update_assignment_request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltiesRewardsUpdateAssignmentResponseBody'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['X-App-Id', 'X-App-Token']

  new_options = opts.merge(
    :operation => :"LoyaltiesApi.update_reward_assignment1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LoyaltiesApi#update_reward_assignment1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end