lib/VoucherifySdk/api/redemptions_api.rb in voucherify-5.0.0 vs lib/VoucherifySdk/api/redemptions_api.rb in voucherify-6.0.0

- old
+ new

@@ -36,14 +36,10 @@ # @return [Array<(RedemptionsGetResponseBody, Integer, Hash)>] RedemptionsGetResponseBody data, response status code and response headers private def get_redemption_with_http_info(redemption_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RedemptionsApi.get_redemption ...' end - # verify the required parameter 'redemption_id' is set - if @api_client.config.client_side_validation && redemption_id.nil? - fail ArgumentError, "Missing the required parameter 'redemption_id' when calling RedemptionsApi.get_redemption" - end # resource path local_var_path = '/v1/redemptions/{redemptionId}'.sub('{' + 'redemptionId' + '}', CGI.escape(redemption_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -99,14 +95,10 @@ # @return [Array<(VouchersRedemptionGetResponseBody, Integer, Hash)>] VouchersRedemptionGetResponseBody data, response status code and response headers private def get_voucher_redemptions_with_http_info(code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RedemptionsApi.get_voucher_redemptions ...' end - # verify the required parameter 'code' is set - if @api_client.config.client_side_validation && code.nil? - fail ArgumentError, "Missing the required parameter 'code' when calling RedemptionsApi.get_voucher_redemptions" - end # resource path local_var_path = '/v1/vouchers/{code}/redemption'.sub('{' + 'code' + '}', CGI.escape(code.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -146,12 +138,12 @@ end # List Redemptions # Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers. # Filtering results The result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date: https://api.voucherify.io/v1/redemptions?limit 3&[created_at][before] 2017-09-08T13:52:18.227Z. A filter based on the object created_at field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: [created_at][after], [created_at][before]. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [created_at][before] 2017-09-08T13:52:18.227Z. # Failed Redemptions A redemption may fail for various reasons. You can figure out an exact reason from the failure_code: - resource_not_found - voucher with given code does not exist - voucher_not_active - voucher is not active yet (before start date) - voucher_expired - voucher has already expired (after expiration date) - voucher_disabled - voucher has been disabled (active: false) - quantity_exceeded - vouchers redemptions limit has been exceeded - gift_amount_exceeded - gift amount has been exceeded - customer_rules_violated - customer did not match the segment - order_rules_violated - order did not match validation rules - invalid_order - order was specified incorrectly - invalid_amount - order amount was specified incorrectly - missing_amount - order amount was not specified - missing_order_items - order items were not specified - missing_customer - customer was not specified # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100 items. - # @option opts [Integer] :page Which page of results to return. + # @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] :result A filter on the list based on the redemption result. Available options are: SUCCESS, FAILURE. You can provide multiple values by repeating the param. # @option opts [String] :campaign A filter by the campaign **name** that the redemption resources originate from. # @option opts [String] :customer Return redemptions performed by the customer with given id or source_id. # @option opts [ParameterOrderListRedemptions] :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 [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][before] 2017-09-08T13:52:18.227Z @@ -163,12 +155,12 @@ end # List Redemptions # Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers. # Filtering results The result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date: https://api.voucherify.io/v1/redemptions?limit 3&amp;[created_at][before] 2017-09-08T13:52:18.227Z. A filter based on the object created_at field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: [created_at][after], [created_at][before]. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [created_at][before] 2017-09-08T13:52:18.227Z. # Failed Redemptions A redemption may fail for various reasons. You can figure out an exact reason from the failure_code: - resource_not_found - voucher with given code does not exist - voucher_not_active - voucher is not active yet (before start date) - voucher_expired - voucher has already expired (after expiration date) - voucher_disabled - voucher has been disabled (active: false) - quantity_exceeded - vouchers redemptions limit has been exceeded - gift_amount_exceeded - gift amount has been exceeded - customer_rules_violated - customer did not match the segment - order_rules_violated - order did not match validation rules - invalid_order - order was specified incorrectly - invalid_amount - order amount was specified incorrectly - missing_amount - order amount was not specified - missing_order_items - order items were not specified - missing_customer - customer was not specified # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100 items. - # @option opts [Integer] :page Which page of results to return. + # @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] :result A filter on the list based on the redemption result. Available options are: SUCCESS, FAILURE. You can provide multiple values by repeating the param. # @option opts [String] :campaign A filter by the campaign **name** that the redemption resources originate from. # @option opts [String] :customer Return redemptions performed by the customer with given id or source_id. # @option opts [ParameterOrderListRedemptions] :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 [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][before] 2017-09-08T13:52:18.227Z @@ -176,22 +168,10 @@ # @return [Array<(RedemptionsListResponseBody, Integer, Hash)>] RedemptionsListResponseBody data, response status code and response headers private def list_redemptions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RedemptionsApi.list_redemptions ...' end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedemptionsApi.list_redemptions, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RedemptionsApi.list_redemptions, must be greater than or equal to 1.' - end - - if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page"]" when calling RedemptionsApi.list_redemptions, must be smaller than or equal to 100.' - end - # resource path local_var_path = '/v1/redemptions' # query parameters query_params = opts[:query_params] || {} @@ -301,11 +281,11 @@ end return data, status_code, headers end # Rollback Redemption - # Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. # Effect The operation - creates a rollback entry in vouchers redemption history (redemption.redemption_entries) and - gives 1 redemption back to the pool (decreases redeemed_quantity by 1). # Returned funds In case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption. + # Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. 🚧 You can roll back a redemption up to 3 months back. # Effect The operation - creates a rollback entry in vouchers redemption history (redemption.redemption_entries) and - gives 1 redemption back to the pool (decreases redeemed_quantity by 1). # Returned funds In case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption. # @param redemption_id [String] The original redemption ID to be rolled back (undone). # @param [Hash] opts the optional parameters # @option opts [String] :reason Reason for the rollback. # @option opts [String] :tracking_id Customers source_id. # @option opts [RedemptionsRollbackCreateRequestBody] :redemptions_rollback_create_request_body Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body. @@ -314,25 +294,21 @@ data, _status_code, _headers = rollback_redemption_with_http_info(redemption_id, opts) data end # Rollback Redemption - # Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. # Effect The operation - creates a rollback entry in vouchers redemption history (redemption.redemption_entries) and - gives 1 redemption back to the pool (decreases redeemed_quantity by 1). # Returned funds In case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption. + # Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. 🚧 You can roll back a redemption up to 3 months back. # Effect The operation - creates a rollback entry in vouchers redemption history (redemption.redemption_entries) and - gives 1 redemption back to the pool (decreases redeemed_quantity by 1). # Returned funds In case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption. # @param redemption_id [String] The original redemption ID to be rolled back (undone). # @param [Hash] opts the optional parameters # @option opts [String] :reason Reason for the rollback. # @option opts [String] :tracking_id Customers source_id. # @option opts [RedemptionsRollbackCreateRequestBody] :redemptions_rollback_create_request_body Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body. # @return [Array<(RedemptionsRollbackCreateResponseBody, Integer, Hash)>] RedemptionsRollbackCreateResponseBody data, response status code and response headers private def rollback_redemption_with_http_info(redemption_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RedemptionsApi.rollback_redemption ...' end - # verify the required parameter 'redemption_id' is set - if @api_client.config.client_side_validation && redemption_id.nil? - fail ArgumentError, "Missing the required parameter 'redemption_id' when calling RedemptionsApi.rollback_redemption" - end # resource path local_var_path = '/v1/redemptions/{redemptionId}/rollback'.sub('{' + 'redemptionId' + '}', CGI.escape(redemption_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -377,11 +353,11 @@ end return data, status_code, headers end # Rollback Stackable Redemptions - # Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter. + # Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter. 🚧 You can roll back a redemption up to 3 months back. # @param parent_redemption_id [String] Unique identifier of a parent redemption, e.g. r_JQfm73zWSJFQxs3bGxweYjgm. # @param [Hash] opts the optional parameters # @option opts [String] :reason Reason for the rollback. # @option opts [String] :tracking_id Customers source_id. # @option opts [RedemptionsRollbacksCreateRequestBody] :redemptions_rollbacks_create_request_body Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body. @@ -390,23 +366,19 @@ data, _status_code, _headers = rollback_stacked_redemptions_with_http_info(parent_redemption_id, opts) data end # Rollback Stackable Redemptions - # Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter. + # Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter. 🚧 You can roll back a redemption up to 3 months back. # @param parent_redemption_id [String] Unique identifier of a parent redemption, e.g. r_JQfm73zWSJFQxs3bGxweYjgm. # @param [Hash] opts the optional parameters # @option opts [String] :reason Reason for the rollback. # @option opts [String] :tracking_id Customers source_id. # @option opts [RedemptionsRollbacksCreateRequestBody] :redemptions_rollbacks_create_request_body Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body. # @return [Array<(RedemptionsRollbacksCreateResponseBody, Integer, Hash)>] RedemptionsRollbacksCreateResponseBody data, response status code and response headers private def rollback_stacked_redemptions_with_http_info(parent_redemption_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RedemptionsApi.rollback_stacked_redemptions ...' - end - # verify the required parameter 'parent_redemption_id' is set - if @api_client.config.client_side_validation && parent_redemption_id.nil? - fail ArgumentError, "Missing the required parameter 'parent_redemption_id' when calling RedemptionsApi.rollback_stacked_redemptions" end # resource path local_var_path = '/v1/redemptions/{parentRedemptionId}/rollbacks'.sub('{' + 'parentRedemptionId' + '}', CGI.escape(parent_redemption_id.to_s)) # query parameters