ifeelgoods 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +81 -0
  4. data/README.md +167 -0
  5. data/Rakefile +10 -0
  6. data/docs/Account.md +34 -0
  7. data/docs/AccountsApi.md +84 -0
  8. data/docs/ActivateRedemptionRequest.md +18 -0
  9. data/docs/ActivateRedemptionRequestData.md +18 -0
  10. data/docs/Address.md +32 -0
  11. data/docs/BrandSummary.md +24 -0
  12. data/docs/BudgetLineItem.md +30 -0
  13. data/docs/CardConsultRedemption200Response.md +18 -0
  14. data/docs/CardConsultRedemption200ResponseData.md +20 -0
  15. data/docs/CardConsultRedemption422Response.md +20 -0
  16. data/docs/ClientDetails.md +40 -0
  17. data/docs/ClientSummary.md +40 -0
  18. data/docs/ClientSummaryBudgetAlerts.md +20 -0
  19. data/docs/ClientsApi.md +341 -0
  20. data/docs/CreateAndRedeemRequest.md +18 -0
  21. data/docs/CreateAndRedeemRequestData.md +24 -0
  22. data/docs/CreateRedemption201Response.md +18 -0
  23. data/docs/CreateRedemption422Response.md +20 -0
  24. data/docs/CreateRedemptionRequest.md +18 -0
  25. data/docs/CreateRedemptionRequestData.md +26 -0
  26. data/docs/CreateRedemptionRequestDataCustomization.md +18 -0
  27. data/docs/CreateRedemptionRequestDataCustomizationPdf.md +20 -0
  28. data/docs/CreateRedemptionRequestDataReward.md +18 -0
  29. data/docs/CreateRedemptionRequestDataValue.md +18 -0
  30. data/docs/Dimension.md +44 -0
  31. data/docs/DimensionDenomination.md +49 -0
  32. data/docs/DiscountSummary.md +28 -0
  33. data/docs/ErrorResponse.md +20 -0
  34. data/docs/GetClientBudgetHistory200Response.md +20 -0
  35. data/docs/GetClientById200Response.md +18 -0
  36. data/docs/GetCurrentAccount200Response.md +18 -0
  37. data/docs/GetPromotionByID200Response.md +18 -0
  38. data/docs/GetPromotionByID401Response.md +20 -0
  39. data/docs/GetPromotionByID404Response.md +20 -0
  40. data/docs/GetRedemptionStats200Response.md +20 -0
  41. data/docs/GetRewardBySKU200Response.md +18 -0
  42. data/docs/ListClientDiscounts200Response.md +20 -0
  43. data/docs/ListClientPromotions200Response.md +20 -0
  44. data/docs/ListClientPromotions200ResponsePaging.md +22 -0
  45. data/docs/ListClientPromotions401Response.md +20 -0
  46. data/docs/ListClientVendorPlaces200Response.md +20 -0
  47. data/docs/ListClients200Response.md +20 -0
  48. data/docs/ListRedemptions200Response.md +20 -0
  49. data/docs/ListRewards200Response.md +20 -0
  50. data/docs/ProductSummary.md +26 -0
  51. data/docs/ProductType.md +20 -0
  52. data/docs/PromotionDetails.md +46 -0
  53. data/docs/PromotionDetailsClient.md +20 -0
  54. data/docs/PromotionDetailsRewardsInner.md +28 -0
  55. data/docs/PromotionsApi.md +173 -0
  56. data/docs/Redemption.md +58 -0
  57. data/docs/RedemptionPromotion.md +24 -0
  58. data/docs/RedemptionReward.md +24 -0
  59. data/docs/RedemptionRewardFormat.md +20 -0
  60. data/docs/RedemptionValue.md +20 -0
  61. data/docs/RedemptionsApi.md +857 -0
  62. data/docs/RewardDetails.md +76 -0
  63. data/docs/RewardDetailsBrand.md +24 -0
  64. data/docs/RewardDetailsDimensions.md +44 -0
  65. data/docs/RewardDetailsProduct.md +26 -0
  66. data/docs/RewardDetailsProductType.md +20 -0
  67. data/docs/RewardDetailsTargeting.md +22 -0
  68. data/docs/RewardFormat.md +20 -0
  69. data/docs/RewardsApi.md +175 -0
  70. data/docs/Stats.md +20 -0
  71. data/docs/StatsApi.md +101 -0
  72. data/docs/StatsTimeframe.md +20 -0
  73. data/docs/StatsValuesInner.md +24 -0
  74. data/docs/StatsValuesInnerGroupByInner.md +26 -0
  75. data/docs/StatsValuesInnerStates.md +34 -0
  76. data/docs/User.md +26 -0
  77. data/docs/VendorPlace.md +26 -0
  78. data/docs/VendorPlaceBrand.md +20 -0
  79. data/docs/VendorPlaceGeoloc.md +20 -0
  80. data/docs/VendorPlacesApi.md +97 -0
  81. data/git_push.sh +57 -0
  82. data/ifeelgoods.gemspec +39 -0
  83. data/lib/ifeelgoods/api/accounts_api.rb +79 -0
  84. data/lib/ifeelgoods/api/clients_api.rb +318 -0
  85. data/lib/ifeelgoods/api/promotions_api.rb +166 -0
  86. data/lib/ifeelgoods/api/redemptions_api.rb +762 -0
  87. data/lib/ifeelgoods/api/rewards_api.rb +166 -0
  88. data/lib/ifeelgoods/api/stats_api.rb +111 -0
  89. data/lib/ifeelgoods/api/vendor_places_api.rb +109 -0
  90. data/lib/ifeelgoods/api_client.rb +397 -0
  91. data/lib/ifeelgoods/api_error.rb +58 -0
  92. data/lib/ifeelgoods/api_model_base.rb +88 -0
  93. data/lib/ifeelgoods/configuration.rb +332 -0
  94. data/lib/ifeelgoods/models/account.rb +260 -0
  95. data/lib/ifeelgoods/models/activate_redemption_request.rb +164 -0
  96. data/lib/ifeelgoods/models/activate_redemption_request_data.rb +147 -0
  97. data/lib/ifeelgoods/models/address.rb +219 -0
  98. data/lib/ifeelgoods/models/brand_summary.rb +212 -0
  99. data/lib/ifeelgoods/models/budget_line_item.rb +249 -0
  100. data/lib/ifeelgoods/models/card_consult_redemption200_response.rb +147 -0
  101. data/lib/ifeelgoods/models/card_consult_redemption200_response_data.rb +158 -0
  102. data/lib/ifeelgoods/models/card_consult_redemption422_response.rb +157 -0
  103. data/lib/ifeelgoods/models/client_details.rb +287 -0
  104. data/lib/ifeelgoods/models/client_summary.rb +287 -0
  105. data/lib/ifeelgoods/models/client_summary_budget_alerts.rb +159 -0
  106. data/lib/ifeelgoods/models/create_and_redeem_request.rb +164 -0
  107. data/lib/ifeelgoods/models/create_and_redeem_request_data.rb +174 -0
  108. data/lib/ifeelgoods/models/create_redemption201_response.rb +147 -0
  109. data/lib/ifeelgoods/models/create_redemption422_response.rb +157 -0
  110. data/lib/ifeelgoods/models/create_redemption_request.rb +164 -0
  111. data/lib/ifeelgoods/models/create_redemption_request_data.rb +235 -0
  112. data/lib/ifeelgoods/models/create_redemption_request_data_customization.rb +147 -0
  113. data/lib/ifeelgoods/models/create_redemption_request_data_customization_pdf.rb +157 -0
  114. data/lib/ifeelgoods/models/create_redemption_request_data_reward.rb +147 -0
  115. data/lib/ifeelgoods/models/create_redemption_request_data_value.rb +148 -0
  116. data/lib/ifeelgoods/models/dimension.rb +293 -0
  117. data/lib/ifeelgoods/models/dimension_denomination.rb +105 -0
  118. data/lib/ifeelgoods/models/discount_summary.rb +195 -0
  119. data/lib/ifeelgoods/models/error_response.rb +157 -0
  120. data/lib/ifeelgoods/models/get_client_budget_history200_response.rb +158 -0
  121. data/lib/ifeelgoods/models/get_client_by_id200_response.rb +147 -0
  122. data/lib/ifeelgoods/models/get_current_account200_response.rb +147 -0
  123. data/lib/ifeelgoods/models/get_promotion_by_id200_response.rb +147 -0
  124. data/lib/ifeelgoods/models/get_promotion_by_id401_response.rb +157 -0
  125. data/lib/ifeelgoods/models/get_promotion_by_id404_response.rb +157 -0
  126. data/lib/ifeelgoods/models/get_redemption_stats200_response.rb +158 -0
  127. data/lib/ifeelgoods/models/get_reward_by_sku200_response.rb +147 -0
  128. data/lib/ifeelgoods/models/list_client_discounts200_response.rb +158 -0
  129. data/lib/ifeelgoods/models/list_client_promotions200_response.rb +158 -0
  130. data/lib/ifeelgoods/models/list_client_promotions200_response_paging.rb +165 -0
  131. data/lib/ifeelgoods/models/list_client_promotions401_response.rb +157 -0
  132. data/lib/ifeelgoods/models/list_client_vendor_places200_response.rb +158 -0
  133. data/lib/ifeelgoods/models/list_clients200_response.rb +158 -0
  134. data/lib/ifeelgoods/models/list_redemptions200_response.rb +158 -0
  135. data/lib/ifeelgoods/models/list_rewards200_response.rb +158 -0
  136. data/lib/ifeelgoods/models/product_summary.rb +222 -0
  137. data/lib/ifeelgoods/models/product_type.rb +204 -0
  138. data/lib/ifeelgoods/models/promotion_details.rb +354 -0
  139. data/lib/ifeelgoods/models/promotion_details_client.rb +157 -0
  140. data/lib/ifeelgoods/models/promotion_details_rewards_inner.rb +245 -0
  141. data/lib/ifeelgoods/models/redemption.rb +383 -0
  142. data/lib/ifeelgoods/models/redemption_promotion.rb +211 -0
  143. data/lib/ifeelgoods/models/redemption_reward.rb +224 -0
  144. data/lib/ifeelgoods/models/redemption_reward_format.rb +193 -0
  145. data/lib/ifeelgoods/models/redemption_value.rb +157 -0
  146. data/lib/ifeelgoods/models/reward_details.rb +486 -0
  147. data/lib/ifeelgoods/models/reward_details_brand.rb +213 -0
  148. data/lib/ifeelgoods/models/reward_details_dimensions.rb +293 -0
  149. data/lib/ifeelgoods/models/reward_details_product.rb +222 -0
  150. data/lib/ifeelgoods/models/reward_details_product_type.rb +204 -0
  151. data/lib/ifeelgoods/models/reward_details_targeting.rb +170 -0
  152. data/lib/ifeelgoods/models/reward_format.rb +192 -0
  153. data/lib/ifeelgoods/models/stats.rb +158 -0
  154. data/lib/ifeelgoods/models/stats_timeframe.rb +156 -0
  155. data/lib/ifeelgoods/models/stats_values_inner.rb +178 -0
  156. data/lib/ifeelgoods/models/stats_values_inner_group_by_inner.rb +186 -0
  157. data/lib/ifeelgoods/models/stats_values_inner_states.rb +219 -0
  158. data/lib/ifeelgoods/models/user.rb +188 -0
  159. data/lib/ifeelgoods/models/vendor_place.rb +186 -0
  160. data/lib/ifeelgoods/models/vendor_place_brand.rb +158 -0
  161. data/lib/ifeelgoods/models/vendor_place_geoloc.rb +156 -0
  162. data/lib/ifeelgoods/version.rb +15 -0
  163. data/lib/ifeelgoods.rb +115 -0
  164. data/spec/api/accounts_api_spec.rb +46 -0
  165. data/spec/api/clients_api_spec.rb +88 -0
  166. data/spec/api/promotions_api_spec.rb +61 -0
  167. data/spec/api/redemptions_api_spec.rb +175 -0
  168. data/spec/api/rewards_api_spec.rb +62 -0
  169. data/spec/api/stats_api_spec.rb +53 -0
  170. data/spec/api/vendor_places_api_spec.rb +51 -0
  171. data/spec/models/account_spec.rb +88 -0
  172. data/spec/models/activate_redemption_request_data_spec.rb +36 -0
  173. data/spec/models/activate_redemption_request_spec.rb +36 -0
  174. data/spec/models/address_spec.rb +78 -0
  175. data/spec/models/brand_summary_spec.rb +58 -0
  176. data/spec/models/budget_line_item_spec.rb +80 -0
  177. data/spec/models/card_consult_redemption200_response_data_spec.rb +42 -0
  178. data/spec/models/card_consult_redemption200_response_spec.rb +36 -0
  179. data/spec/models/card_consult_redemption422_response_spec.rb +42 -0
  180. data/spec/models/client_details_spec.rb +106 -0
  181. data/spec/models/client_summary_budget_alerts_spec.rb +42 -0
  182. data/spec/models/client_summary_spec.rb +106 -0
  183. data/spec/models/create_and_redeem_request_data_spec.rb +54 -0
  184. data/spec/models/create_and_redeem_request_spec.rb +36 -0
  185. data/spec/models/create_redemption201_response_spec.rb +36 -0
  186. data/spec/models/create_redemption422_response_spec.rb +42 -0
  187. data/spec/models/create_redemption_request_data_customization_pdf_spec.rb +42 -0
  188. data/spec/models/create_redemption_request_data_customization_spec.rb +36 -0
  189. data/spec/models/create_redemption_request_data_reward_spec.rb +36 -0
  190. data/spec/models/create_redemption_request_data_spec.rb +60 -0
  191. data/spec/models/create_redemption_request_data_value_spec.rb +36 -0
  192. data/spec/models/create_redemption_request_spec.rb +36 -0
  193. data/spec/models/dimension_denomination_spec.rb +32 -0
  194. data/spec/models/dimension_spec.rb +114 -0
  195. data/spec/models/discount_summary_spec.rb +66 -0
  196. data/spec/models/error_response_spec.rb +42 -0
  197. data/spec/models/get_client_budget_history200_response_spec.rb +42 -0
  198. data/spec/models/get_client_by_id200_response_spec.rb +36 -0
  199. data/spec/models/get_current_account200_response_spec.rb +36 -0
  200. data/spec/models/get_promotion_by_id200_response_spec.rb +36 -0
  201. data/spec/models/get_promotion_by_id401_response_spec.rb +42 -0
  202. data/spec/models/get_promotion_by_id404_response_spec.rb +42 -0
  203. data/spec/models/get_redemption_stats200_response_spec.rb +42 -0
  204. data/spec/models/get_reward_by_sku200_response_spec.rb +36 -0
  205. data/spec/models/list_client_discounts200_response_spec.rb +42 -0
  206. data/spec/models/list_client_promotions200_response_paging_spec.rb +48 -0
  207. data/spec/models/list_client_promotions200_response_spec.rb +42 -0
  208. data/spec/models/list_client_promotions401_response_spec.rb +42 -0
  209. data/spec/models/list_client_vendor_places200_response_spec.rb +42 -0
  210. data/spec/models/list_clients200_response_spec.rb +42 -0
  211. data/spec/models/list_redemptions200_response_spec.rb +42 -0
  212. data/spec/models/list_rewards200_response_spec.rb +42 -0
  213. data/spec/models/product_summary_spec.rb +64 -0
  214. data/spec/models/product_type_spec.rb +50 -0
  215. data/spec/models/promotion_details_client_spec.rb +42 -0
  216. data/spec/models/promotion_details_rewards_inner_spec.rb +78 -0
  217. data/spec/models/promotion_details_spec.rb +136 -0
  218. data/spec/models/redemption_promotion_spec.rb +58 -0
  219. data/spec/models/redemption_reward_format_spec.rb +50 -0
  220. data/spec/models/redemption_reward_spec.rb +62 -0
  221. data/spec/models/redemption_spec.rb +168 -0
  222. data/spec/models/redemption_value_spec.rb +42 -0
  223. data/spec/models/reward_details_brand_spec.rb +58 -0
  224. data/spec/models/reward_details_dimensions_spec.rb +114 -0
  225. data/spec/models/reward_details_product_spec.rb +64 -0
  226. data/spec/models/reward_details_product_type_spec.rb +50 -0
  227. data/spec/models/reward_details_spec.rb +218 -0
  228. data/spec/models/reward_details_targeting_spec.rb +48 -0
  229. data/spec/models/reward_format_spec.rb +50 -0
  230. data/spec/models/stats_spec.rb +42 -0
  231. data/spec/models/stats_timeframe_spec.rb +42 -0
  232. data/spec/models/stats_values_inner_group_by_inner_spec.rb +60 -0
  233. data/spec/models/stats_values_inner_spec.rb +54 -0
  234. data/spec/models/stats_values_inner_states_spec.rb +84 -0
  235. data/spec/models/user_spec.rb +60 -0
  236. data/spec/models/vendor_place_brand_spec.rb +42 -0
  237. data/spec/models/vendor_place_geoloc_spec.rb +42 -0
  238. data/spec/models/vendor_place_spec.rb +60 -0
  239. data/spec/spec_helper.rb +111 -0
  240. metadata +397 -0
@@ -0,0 +1,857 @@
1
+ # Ifeelgoods::RedemptionsApi
2
+
3
+ All URIs are relative to *https://api-sandbox.ifeelgoods.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**activate_redemption**](RedemptionsApi.md#activate_redemption) | **POST** /fulfillment/v2/redemptions/{redemption_id}/actions/activate | Activate |
8
+ | [**book_redemption**](RedemptionsApi.md#book_redemption) | **POST** /fulfillment/v2/promotions/{promotion_id}/rewards/{reward_sku}/redemptions/book | Book |
9
+ | [**cancel_redemption**](RedemptionsApi.md#cancel_redemption) | **POST** /fulfillment/v2/redemptions/{redemption_id}/actions/cancel | Cancel |
10
+ | [**card_consult_redemption**](RedemptionsApi.md#card_consult_redemption) | **GET** /fulfillment/v2/redemptions/{redemption_id}/card_consult | Consult Card |
11
+ | [**create_and_redeem**](RedemptionsApi.md#create_and_redeem) | **POST** /fulfillment/v2/promotions/{promotion_id}/rewards/{reward_sku}/redemptions/redeem | Create and Redeem |
12
+ | [**create_redemption**](RedemptionsApi.md#create_redemption) | **POST** /fulfillment/v2/promotions/{promotion_id}/redemptions | Create a redemption |
13
+ | [**get_redemption_by_id**](RedemptionsApi.md#get_redemption_by_id) | **GET** /fulfillment/v2/redemptions/{redemption_id} | Get a redemption |
14
+ | [**list_redemptions**](RedemptionsApi.md#list_redemptions) | **GET** /fulfillment/v2/promotions/{promotion_id}/redemptions | List all Redemptions |
15
+ | [**redeem_redemption**](RedemptionsApi.md#redeem_redemption) | **POST** /fulfillment/v2/redemptions/{redemption_id}/actions/redeem | Redeem |
16
+ | [**refund_redemption**](RedemptionsApi.md#refund_redemption) | **POST** /fulfillment/v2/redemptions/{redemption_id}/actions/refund | Refund |
17
+
18
+
19
+ ## activate_redemption
20
+
21
+ > <CreateRedemption201Response> activate_redemption(redemption_id, opts)
22
+
23
+ Activate
24
+
25
+ Use this function to perform an activation from an existing redemption object and retrieve a authenticated link (url key).
26
+
27
+ ### Examples
28
+
29
+ ```ruby
30
+ require 'time'
31
+ require 'ifeelgoods'
32
+ # setup authorization
33
+ Ifeelgoods.configure do |config|
34
+ # Configure API key authorization: api_key
35
+ config.api_key['Api-Key'] = 'YOUR API KEY'
36
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
37
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
38
+
39
+ # Configure Bearer authorization: bearer_auth
40
+ config.access_token = 'YOUR_BEARER_TOKEN'
41
+
42
+ # Configure API key authorization: api_secret
43
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
44
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
45
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
46
+ end
47
+
48
+ api_instance = Ifeelgoods::RedemptionsApi.new
49
+ redemption_id = 'redemption_id_example' # String | Unique Redemption identifier (eg. ZN7RS-9RNLY)
50
+ opts = {
51
+ activate_redemption_request: Ifeelgoods::ActivateRedemptionRequest.new({data: Ifeelgoods::ActivateRedemptionRequestData.new}) # ActivateRedemptionRequest |
52
+ }
53
+
54
+ begin
55
+ # Activate
56
+ result = api_instance.activate_redemption(redemption_id, opts)
57
+ p result
58
+ rescue Ifeelgoods::ApiError => e
59
+ puts "Error when calling RedemptionsApi->activate_redemption: #{e}"
60
+ end
61
+ ```
62
+
63
+ #### Using the activate_redemption_with_http_info variant
64
+
65
+ This returns an Array which contains the response data, status code and headers.
66
+
67
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> activate_redemption_with_http_info(redemption_id, opts)
68
+
69
+ ```ruby
70
+ begin
71
+ # Activate
72
+ data, status_code, headers = api_instance.activate_redemption_with_http_info(redemption_id, opts)
73
+ p status_code # => 2xx
74
+ p headers # => { ... }
75
+ p data # => <CreateRedemption201Response>
76
+ rescue Ifeelgoods::ApiError => e
77
+ puts "Error when calling RedemptionsApi->activate_redemption_with_http_info: #{e}"
78
+ end
79
+ ```
80
+
81
+ ### Parameters
82
+
83
+ | Name | Type | Description | Notes |
84
+ | ---- | ---- | ----------- | ----- |
85
+ | **redemption_id** | **String** | Unique Redemption identifier (eg. ZN7RS-9RNLY) | |
86
+ | **activate_redemption_request** | [**ActivateRedemptionRequest**](ActivateRedemptionRequest.md) | | [optional] |
87
+
88
+ ### Return type
89
+
90
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
91
+
92
+ ### Authorization
93
+
94
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
95
+
96
+ ### HTTP request headers
97
+
98
+ - **Content-Type**: application/json
99
+ - **Accept**: application/json, application/pdf
100
+
101
+
102
+ ## book_redemption
103
+
104
+ > <CreateRedemption201Response> book_redemption(promotion_id, reward_sku, opts)
105
+
106
+ Book
107
+
108
+ Use this function to book a reward code before redeem it. This action will do the same as in Create a Redemption API but will also book a reward code for a duration of 30 minutes. You can then redeem the redemption using Create and Redeem or Redeem APIs using the same parameters (eg. same order_id and user email).
109
+
110
+ ### Examples
111
+
112
+ ```ruby
113
+ require 'time'
114
+ require 'ifeelgoods'
115
+ # setup authorization
116
+ Ifeelgoods.configure do |config|
117
+ # Configure API key authorization: api_key
118
+ config.api_key['Api-Key'] = 'YOUR API KEY'
119
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
120
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
121
+
122
+ # Configure Bearer authorization: bearer_auth
123
+ config.access_token = 'YOUR_BEARER_TOKEN'
124
+
125
+ # Configure API key authorization: api_secret
126
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
127
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
128
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
129
+ end
130
+
131
+ api_instance = Ifeelgoods::RedemptionsApi.new
132
+ promotion_id = 'promotion_id_example' # String | The promotion identifier
133
+ reward_sku = 'reward_sku_example' # String | The reward SKU
134
+ opts = {
135
+ create_and_redeem_request: Ifeelgoods::CreateAndRedeemRequest.new({data: Ifeelgoods::CreateAndRedeemRequestData.new}) # CreateAndRedeemRequest |
136
+ }
137
+
138
+ begin
139
+ # Book
140
+ result = api_instance.book_redemption(promotion_id, reward_sku, opts)
141
+ p result
142
+ rescue Ifeelgoods::ApiError => e
143
+ puts "Error when calling RedemptionsApi->book_redemption: #{e}"
144
+ end
145
+ ```
146
+
147
+ #### Using the book_redemption_with_http_info variant
148
+
149
+ This returns an Array which contains the response data, status code and headers.
150
+
151
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> book_redemption_with_http_info(promotion_id, reward_sku, opts)
152
+
153
+ ```ruby
154
+ begin
155
+ # Book
156
+ data, status_code, headers = api_instance.book_redemption_with_http_info(promotion_id, reward_sku, opts)
157
+ p status_code # => 2xx
158
+ p headers # => { ... }
159
+ p data # => <CreateRedemption201Response>
160
+ rescue Ifeelgoods::ApiError => e
161
+ puts "Error when calling RedemptionsApi->book_redemption_with_http_info: #{e}"
162
+ end
163
+ ```
164
+
165
+ ### Parameters
166
+
167
+ | Name | Type | Description | Notes |
168
+ | ---- | ---- | ----------- | ----- |
169
+ | **promotion_id** | **String** | The promotion identifier | |
170
+ | **reward_sku** | **String** | The reward SKU | |
171
+ | **create_and_redeem_request** | [**CreateAndRedeemRequest**](CreateAndRedeemRequest.md) | | [optional] |
172
+
173
+ ### Return type
174
+
175
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
176
+
177
+ ### Authorization
178
+
179
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
180
+
181
+ ### HTTP request headers
182
+
183
+ - **Content-Type**: application/json
184
+ - **Accept**: application/json
185
+
186
+
187
+ ## cancel_redemption
188
+
189
+ > <CreateRedemption201Response> cancel_redemption(redemption_id)
190
+
191
+ Cancel
192
+
193
+ Use this function to cancel a pending/failed redemption.
194
+
195
+ ### Examples
196
+
197
+ ```ruby
198
+ require 'time'
199
+ require 'ifeelgoods'
200
+ # setup authorization
201
+ Ifeelgoods.configure do |config|
202
+ # Configure API key authorization: api_key
203
+ config.api_key['Api-Key'] = 'YOUR API KEY'
204
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
205
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
206
+
207
+ # Configure Bearer authorization: bearer_auth
208
+ config.access_token = 'YOUR_BEARER_TOKEN'
209
+
210
+ # Configure API key authorization: api_secret
211
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
212
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
213
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
214
+ end
215
+
216
+ api_instance = Ifeelgoods::RedemptionsApi.new
217
+ redemption_id = 'redemption_id_example' # String | The redemption identifier
218
+
219
+ begin
220
+ # Cancel
221
+ result = api_instance.cancel_redemption(redemption_id)
222
+ p result
223
+ rescue Ifeelgoods::ApiError => e
224
+ puts "Error when calling RedemptionsApi->cancel_redemption: #{e}"
225
+ end
226
+ ```
227
+
228
+ #### Using the cancel_redemption_with_http_info variant
229
+
230
+ This returns an Array which contains the response data, status code and headers.
231
+
232
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> cancel_redemption_with_http_info(redemption_id)
233
+
234
+ ```ruby
235
+ begin
236
+ # Cancel
237
+ data, status_code, headers = api_instance.cancel_redemption_with_http_info(redemption_id)
238
+ p status_code # => 2xx
239
+ p headers # => { ... }
240
+ p data # => <CreateRedemption201Response>
241
+ rescue Ifeelgoods::ApiError => e
242
+ puts "Error when calling RedemptionsApi->cancel_redemption_with_http_info: #{e}"
243
+ end
244
+ ```
245
+
246
+ ### Parameters
247
+
248
+ | Name | Type | Description | Notes |
249
+ | ---- | ---- | ----------- | ----- |
250
+ | **redemption_id** | **String** | The redemption identifier | |
251
+
252
+ ### Return type
253
+
254
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
255
+
256
+ ### Authorization
257
+
258
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
259
+
260
+ ### HTTP request headers
261
+
262
+ - **Content-Type**: Not defined
263
+ - **Accept**: application/json
264
+
265
+
266
+ ## card_consult_redemption
267
+
268
+ > <CardConsultRedemption200Response> card_consult_redemption(redemption_id)
269
+
270
+ Consult Card
271
+
272
+ Use this function to retrieve card information (balance, currency) for a redemption when supported by the reward provider.
273
+
274
+ ### Examples
275
+
276
+ ```ruby
277
+ require 'time'
278
+ require 'ifeelgoods'
279
+ # setup authorization
280
+ Ifeelgoods.configure do |config|
281
+ # Configure API key authorization: api_key
282
+ config.api_key['Api-Key'] = 'YOUR API KEY'
283
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
284
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
285
+
286
+ # Configure Bearer authorization: bearer_auth
287
+ config.access_token = 'YOUR_BEARER_TOKEN'
288
+
289
+ # Configure API key authorization: api_secret
290
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
291
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
292
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
293
+ end
294
+
295
+ api_instance = Ifeelgoods::RedemptionsApi.new
296
+ redemption_id = 'redemption_id_example' # String | The redemption identifier
297
+
298
+ begin
299
+ # Consult Card
300
+ result = api_instance.card_consult_redemption(redemption_id)
301
+ p result
302
+ rescue Ifeelgoods::ApiError => e
303
+ puts "Error when calling RedemptionsApi->card_consult_redemption: #{e}"
304
+ end
305
+ ```
306
+
307
+ #### Using the card_consult_redemption_with_http_info variant
308
+
309
+ This returns an Array which contains the response data, status code and headers.
310
+
311
+ > <Array(<CardConsultRedemption200Response>, Integer, Hash)> card_consult_redemption_with_http_info(redemption_id)
312
+
313
+ ```ruby
314
+ begin
315
+ # Consult Card
316
+ data, status_code, headers = api_instance.card_consult_redemption_with_http_info(redemption_id)
317
+ p status_code # => 2xx
318
+ p headers # => { ... }
319
+ p data # => <CardConsultRedemption200Response>
320
+ rescue Ifeelgoods::ApiError => e
321
+ puts "Error when calling RedemptionsApi->card_consult_redemption_with_http_info: #{e}"
322
+ end
323
+ ```
324
+
325
+ ### Parameters
326
+
327
+ | Name | Type | Description | Notes |
328
+ | ---- | ---- | ----------- | ----- |
329
+ | **redemption_id** | **String** | The redemption identifier | |
330
+
331
+ ### Return type
332
+
333
+ [**CardConsultRedemption200Response**](CardConsultRedemption200Response.md)
334
+
335
+ ### Authorization
336
+
337
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
338
+
339
+ ### HTTP request headers
340
+
341
+ - **Content-Type**: Not defined
342
+ - **Accept**: application/json
343
+
344
+
345
+ ## create_and_redeem
346
+
347
+ > <CreateRedemption201Response> create_and_redeem(promotion_id, reward_sku, opts)
348
+
349
+ Create and Redeem
350
+
351
+ Use this function to create a redemption object and perform a reward delivery. Calling this endpoint on an existing order_id with the exact same parameters will return the existing order.
352
+
353
+ ### Examples
354
+
355
+ ```ruby
356
+ require 'time'
357
+ require 'ifeelgoods'
358
+ # setup authorization
359
+ Ifeelgoods.configure do |config|
360
+ # Configure API key authorization: api_key
361
+ config.api_key['Api-Key'] = 'YOUR API KEY'
362
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
363
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
364
+
365
+ # Configure Bearer authorization: bearer_auth
366
+ config.access_token = 'YOUR_BEARER_TOKEN'
367
+
368
+ # Configure API key authorization: api_secret
369
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
370
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
371
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
372
+ end
373
+
374
+ api_instance = Ifeelgoods::RedemptionsApi.new
375
+ promotion_id = 'promotion_id_example' # String | The promotion identifier
376
+ reward_sku = 'reward_sku_example' # String | The reward SKU
377
+ opts = {
378
+ create_and_redeem_request: Ifeelgoods::CreateAndRedeemRequest.new({data: Ifeelgoods::CreateAndRedeemRequestData.new}) # CreateAndRedeemRequest |
379
+ }
380
+
381
+ begin
382
+ # Create and Redeem
383
+ result = api_instance.create_and_redeem(promotion_id, reward_sku, opts)
384
+ p result
385
+ rescue Ifeelgoods::ApiError => e
386
+ puts "Error when calling RedemptionsApi->create_and_redeem: #{e}"
387
+ end
388
+ ```
389
+
390
+ #### Using the create_and_redeem_with_http_info variant
391
+
392
+ This returns an Array which contains the response data, status code and headers.
393
+
394
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> create_and_redeem_with_http_info(promotion_id, reward_sku, opts)
395
+
396
+ ```ruby
397
+ begin
398
+ # Create and Redeem
399
+ data, status_code, headers = api_instance.create_and_redeem_with_http_info(promotion_id, reward_sku, opts)
400
+ p status_code # => 2xx
401
+ p headers # => { ... }
402
+ p data # => <CreateRedemption201Response>
403
+ rescue Ifeelgoods::ApiError => e
404
+ puts "Error when calling RedemptionsApi->create_and_redeem_with_http_info: #{e}"
405
+ end
406
+ ```
407
+
408
+ ### Parameters
409
+
410
+ | Name | Type | Description | Notes |
411
+ | ---- | ---- | ----------- | ----- |
412
+ | **promotion_id** | **String** | The promotion identifier | |
413
+ | **reward_sku** | **String** | The reward SKU | |
414
+ | **create_and_redeem_request** | [**CreateAndRedeemRequest**](CreateAndRedeemRequest.md) | | [optional] |
415
+
416
+ ### Return type
417
+
418
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
419
+
420
+ ### Authorization
421
+
422
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
423
+
424
+ ### HTTP request headers
425
+
426
+ - **Content-Type**: application/json
427
+ - **Accept**: application/json, application/pdf
428
+
429
+
430
+ ## create_redemption
431
+
432
+ > <CreateRedemption201Response> create_redemption(promotion_id, create_redemption_request)
433
+
434
+ Create a redemption
435
+
436
+ Use this function to create a redemption object and initiate a reward delivery.
437
+
438
+ ### Examples
439
+
440
+ ```ruby
441
+ require 'time'
442
+ require 'ifeelgoods'
443
+ # setup authorization
444
+ Ifeelgoods.configure do |config|
445
+ # Configure API key authorization: api_key
446
+ config.api_key['Api-Key'] = 'YOUR API KEY'
447
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
448
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
449
+
450
+ # Configure Bearer authorization: bearer_auth
451
+ config.access_token = 'YOUR_BEARER_TOKEN'
452
+
453
+ # Configure API key authorization: api_secret
454
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
455
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
456
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
457
+ end
458
+
459
+ api_instance = Ifeelgoods::RedemptionsApi.new
460
+ promotion_id = 'promotion_id_example' # String | The promotion identifier
461
+ create_redemption_request = Ifeelgoods::CreateRedemptionRequest.new({data: Ifeelgoods::CreateRedemptionRequestData.new({order_id: 'order_id_example', user: Ifeelgoods::User.new, reward: Ifeelgoods::CreateRedemptionRequestDataReward.new})}) # CreateRedemptionRequest |
462
+
463
+ begin
464
+ # Create a redemption
465
+ result = api_instance.create_redemption(promotion_id, create_redemption_request)
466
+ p result
467
+ rescue Ifeelgoods::ApiError => e
468
+ puts "Error when calling RedemptionsApi->create_redemption: #{e}"
469
+ end
470
+ ```
471
+
472
+ #### Using the create_redemption_with_http_info variant
473
+
474
+ This returns an Array which contains the response data, status code and headers.
475
+
476
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> create_redemption_with_http_info(promotion_id, create_redemption_request)
477
+
478
+ ```ruby
479
+ begin
480
+ # Create a redemption
481
+ data, status_code, headers = api_instance.create_redemption_with_http_info(promotion_id, create_redemption_request)
482
+ p status_code # => 2xx
483
+ p headers # => { ... }
484
+ p data # => <CreateRedemption201Response>
485
+ rescue Ifeelgoods::ApiError => e
486
+ puts "Error when calling RedemptionsApi->create_redemption_with_http_info: #{e}"
487
+ end
488
+ ```
489
+
490
+ ### Parameters
491
+
492
+ | Name | Type | Description | Notes |
493
+ | ---- | ---- | ----------- | ----- |
494
+ | **promotion_id** | **String** | The promotion identifier | |
495
+ | **create_redemption_request** | [**CreateRedemptionRequest**](CreateRedemptionRequest.md) | | |
496
+
497
+ ### Return type
498
+
499
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
500
+
501
+ ### Authorization
502
+
503
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
504
+
505
+ ### HTTP request headers
506
+
507
+ - **Content-Type**: application/json
508
+ - **Accept**: application/json, application/pdf
509
+
510
+
511
+ ## get_redemption_by_id
512
+
513
+ > <CreateRedemption201Response> get_redemption_by_id(redemption_id)
514
+
515
+ Get a redemption
516
+
517
+ Use this function to retrieve detailed information about a redemption object.
518
+
519
+ ### Examples
520
+
521
+ ```ruby
522
+ require 'time'
523
+ require 'ifeelgoods'
524
+ # setup authorization
525
+ Ifeelgoods.configure do |config|
526
+ # Configure API key authorization: api_key
527
+ config.api_key['Api-Key'] = 'YOUR API KEY'
528
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
529
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
530
+
531
+ # Configure Bearer authorization: bearer_auth
532
+ config.access_token = 'YOUR_BEARER_TOKEN'
533
+
534
+ # Configure API key authorization: api_secret
535
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
536
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
537
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
538
+ end
539
+
540
+ api_instance = Ifeelgoods::RedemptionsApi.new
541
+ redemption_id = 'redemption_id_example' # String | The redemption identifier
542
+
543
+ begin
544
+ # Get a redemption
545
+ result = api_instance.get_redemption_by_id(redemption_id)
546
+ p result
547
+ rescue Ifeelgoods::ApiError => e
548
+ puts "Error when calling RedemptionsApi->get_redemption_by_id: #{e}"
549
+ end
550
+ ```
551
+
552
+ #### Using the get_redemption_by_id_with_http_info variant
553
+
554
+ This returns an Array which contains the response data, status code and headers.
555
+
556
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> get_redemption_by_id_with_http_info(redemption_id)
557
+
558
+ ```ruby
559
+ begin
560
+ # Get a redemption
561
+ data, status_code, headers = api_instance.get_redemption_by_id_with_http_info(redemption_id)
562
+ p status_code # => 2xx
563
+ p headers # => { ... }
564
+ p data # => <CreateRedemption201Response>
565
+ rescue Ifeelgoods::ApiError => e
566
+ puts "Error when calling RedemptionsApi->get_redemption_by_id_with_http_info: #{e}"
567
+ end
568
+ ```
569
+
570
+ ### Parameters
571
+
572
+ | Name | Type | Description | Notes |
573
+ | ---- | ---- | ----------- | ----- |
574
+ | **redemption_id** | **String** | The redemption identifier | |
575
+
576
+ ### Return type
577
+
578
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
579
+
580
+ ### Authorization
581
+
582
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
583
+
584
+ ### HTTP request headers
585
+
586
+ - **Content-Type**: Not defined
587
+ - **Accept**: application/json, application/pdf
588
+
589
+
590
+ ## list_redemptions
591
+
592
+ > <ListRedemptions200Response> list_redemptions(promotion_id, opts)
593
+
594
+ List all Redemptions
595
+
596
+ Use this function to list the status of all redemptions created as part of a promotion.
597
+
598
+ ### Examples
599
+
600
+ ```ruby
601
+ require 'time'
602
+ require 'ifeelgoods'
603
+ # setup authorization
604
+ Ifeelgoods.configure do |config|
605
+ # Configure API key authorization: api_key
606
+ config.api_key['Api-Key'] = 'YOUR API KEY'
607
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
608
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
609
+
610
+ # Configure Bearer authorization: bearer_auth
611
+ config.access_token = 'YOUR_BEARER_TOKEN'
612
+
613
+ # Configure API key authorization: api_secret
614
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
615
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
616
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
617
+ end
618
+
619
+ api_instance = Ifeelgoods::RedemptionsApi.new
620
+ promotion_id = 'promotion_id_example' # String | The promotion identifier
621
+ opts = {
622
+ reward_sku: 'reward_sku_example', # String |
623
+ email: 'email_example', # String |
624
+ order_id: 'order_id_example', # String |
625
+ state: 'pending', # String | Redemption state filter (eg. `pending`, `redeemed`, `canceled`, etc.)
626
+ redeemed_datetime_start: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Filter redemptions redeemed on or after this datetime (ISO 8601 format, e.g. `2024-01-01T00:00:00Z`)
627
+ redeemed_datetime_end: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Filter redemptions redeemed on or before this datetime (ISO 8601 format, e.g. `2024-01-31T23:59:59Z`)
628
+ activation_datetime_start: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Filter redemptions activated on or after this datetime (ISO 8601 format, e.g. `2024-01-01T00:00:00Z`)
629
+ activation_datetime_end: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Filter redemptions activated on or before this datetime (ISO 8601 format, e.g. `2024-01-31T23:59:59Z`)
630
+ refund_datetime_start: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Filter redemptions refunded on or after this datetime (ISO 8601 format, e.g. `2024-01-01T00:00:00Z`)
631
+ refund_datetime_end: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Filter redemptions refunded on or before this datetime (ISO 8601 format, e.g. `2024-01-31T23:59:59Z`)
632
+ sort: 'activation_datetime', # String | Field to sort by, prefixed with `-` for descending order (e.g. `activation_datetime` or `-activation_datetime`)
633
+ page: 56, # Integer |
634
+ per_page: 56 # Integer |
635
+ }
636
+
637
+ begin
638
+ # List all Redemptions
639
+ result = api_instance.list_redemptions(promotion_id, opts)
640
+ p result
641
+ rescue Ifeelgoods::ApiError => e
642
+ puts "Error when calling RedemptionsApi->list_redemptions: #{e}"
643
+ end
644
+ ```
645
+
646
+ #### Using the list_redemptions_with_http_info variant
647
+
648
+ This returns an Array which contains the response data, status code and headers.
649
+
650
+ > <Array(<ListRedemptions200Response>, Integer, Hash)> list_redemptions_with_http_info(promotion_id, opts)
651
+
652
+ ```ruby
653
+ begin
654
+ # List all Redemptions
655
+ data, status_code, headers = api_instance.list_redemptions_with_http_info(promotion_id, opts)
656
+ p status_code # => 2xx
657
+ p headers # => { ... }
658
+ p data # => <ListRedemptions200Response>
659
+ rescue Ifeelgoods::ApiError => e
660
+ puts "Error when calling RedemptionsApi->list_redemptions_with_http_info: #{e}"
661
+ end
662
+ ```
663
+
664
+ ### Parameters
665
+
666
+ | Name | Type | Description | Notes |
667
+ | ---- | ---- | ----------- | ----- |
668
+ | **promotion_id** | **String** | The promotion identifier | |
669
+ | **reward_sku** | **String** | | [optional] |
670
+ | **email** | **String** | | [optional] |
671
+ | **order_id** | **String** | | [optional] |
672
+ | **state** | **String** | Redemption state filter (eg. &#x60;pending&#x60;, &#x60;redeemed&#x60;, &#x60;canceled&#x60;, etc.) | [optional] |
673
+ | **redeemed_datetime_start** | **Time** | Filter redemptions redeemed on or after this datetime (ISO 8601 format, e.g. &#x60;2024-01-01T00:00:00Z&#x60;) | [optional] |
674
+ | **redeemed_datetime_end** | **Time** | Filter redemptions redeemed on or before this datetime (ISO 8601 format, e.g. &#x60;2024-01-31T23:59:59Z&#x60;) | [optional] |
675
+ | **activation_datetime_start** | **Time** | Filter redemptions activated on or after this datetime (ISO 8601 format, e.g. &#x60;2024-01-01T00:00:00Z&#x60;) | [optional] |
676
+ | **activation_datetime_end** | **Time** | Filter redemptions activated on or before this datetime (ISO 8601 format, e.g. &#x60;2024-01-31T23:59:59Z&#x60;) | [optional] |
677
+ | **refund_datetime_start** | **Time** | Filter redemptions refunded on or after this datetime (ISO 8601 format, e.g. &#x60;2024-01-01T00:00:00Z&#x60;) | [optional] |
678
+ | **refund_datetime_end** | **Time** | Filter redemptions refunded on or before this datetime (ISO 8601 format, e.g. &#x60;2024-01-31T23:59:59Z&#x60;) | [optional] |
679
+ | **sort** | **String** | Field to sort by, prefixed with &#x60;-&#x60; for descending order (e.g. &#x60;activation_datetime&#x60; or &#x60;-activation_datetime&#x60;) | [optional] |
680
+ | **page** | **Integer** | | [optional][default to 1] |
681
+ | **per_page** | **Integer** | | [optional][default to 20] |
682
+
683
+ ### Return type
684
+
685
+ [**ListRedemptions200Response**](ListRedemptions200Response.md)
686
+
687
+ ### Authorization
688
+
689
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
690
+
691
+ ### HTTP request headers
692
+
693
+ - **Content-Type**: Not defined
694
+ - **Accept**: application/json
695
+
696
+
697
+ ## redeem_redemption
698
+
699
+ > <CreateRedemption201Response> redeem_redemption(redemption_id, opts)
700
+
701
+ Redeem
702
+
703
+ Use this function to perform a reward delivery from an existing redemption object.
704
+
705
+ ### Examples
706
+
707
+ ```ruby
708
+ require 'time'
709
+ require 'ifeelgoods'
710
+ # setup authorization
711
+ Ifeelgoods.configure do |config|
712
+ # Configure API key authorization: api_key
713
+ config.api_key['Api-Key'] = 'YOUR API KEY'
714
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
715
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
716
+
717
+ # Configure Bearer authorization: bearer_auth
718
+ config.access_token = 'YOUR_BEARER_TOKEN'
719
+
720
+ # Configure API key authorization: api_secret
721
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
722
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
723
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
724
+ end
725
+
726
+ api_instance = Ifeelgoods::RedemptionsApi.new
727
+ redemption_id = 'redemption_id_example' # String | Unique Redemption identifier (eg. ZN7RS-9RNLY)
728
+ opts = {
729
+ activate_redemption_request: Ifeelgoods::ActivateRedemptionRequest.new({data: Ifeelgoods::ActivateRedemptionRequestData.new}) # ActivateRedemptionRequest |
730
+ }
731
+
732
+ begin
733
+ # Redeem
734
+ result = api_instance.redeem_redemption(redemption_id, opts)
735
+ p result
736
+ rescue Ifeelgoods::ApiError => e
737
+ puts "Error when calling RedemptionsApi->redeem_redemption: #{e}"
738
+ end
739
+ ```
740
+
741
+ #### Using the redeem_redemption_with_http_info variant
742
+
743
+ This returns an Array which contains the response data, status code and headers.
744
+
745
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> redeem_redemption_with_http_info(redemption_id, opts)
746
+
747
+ ```ruby
748
+ begin
749
+ # Redeem
750
+ data, status_code, headers = api_instance.redeem_redemption_with_http_info(redemption_id, opts)
751
+ p status_code # => 2xx
752
+ p headers # => { ... }
753
+ p data # => <CreateRedemption201Response>
754
+ rescue Ifeelgoods::ApiError => e
755
+ puts "Error when calling RedemptionsApi->redeem_redemption_with_http_info: #{e}"
756
+ end
757
+ ```
758
+
759
+ ### Parameters
760
+
761
+ | Name | Type | Description | Notes |
762
+ | ---- | ---- | ----------- | ----- |
763
+ | **redemption_id** | **String** | Unique Redemption identifier (eg. ZN7RS-9RNLY) | |
764
+ | **activate_redemption_request** | [**ActivateRedemptionRequest**](ActivateRedemptionRequest.md) | | [optional] |
765
+
766
+ ### Return type
767
+
768
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
769
+
770
+ ### Authorization
771
+
772
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
773
+
774
+ ### HTTP request headers
775
+
776
+ - **Content-Type**: application/json
777
+ - **Accept**: application/json, application/pdf
778
+
779
+
780
+ ## refund_redemption
781
+
782
+ > <CreateRedemption201Response> refund_redemption(redemption_id)
783
+
784
+ Refund
785
+
786
+ Refunds a redemption if it is redeemed, or if debited = true and the state is booked, failed, or pending. Only redemptions from the current month are refundable.
787
+
788
+ ### Examples
789
+
790
+ ```ruby
791
+ require 'time'
792
+ require 'ifeelgoods'
793
+ # setup authorization
794
+ Ifeelgoods.configure do |config|
795
+ # Configure API key authorization: api_key
796
+ config.api_key['Api-Key'] = 'YOUR API KEY'
797
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
798
+ # config.api_key_prefix['Api-Key'] = 'Bearer'
799
+
800
+ # Configure Bearer authorization: bearer_auth
801
+ config.access_token = 'YOUR_BEARER_TOKEN'
802
+
803
+ # Configure API key authorization: api_secret
804
+ config.api_key['Api-Secret'] = 'YOUR API KEY'
805
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
806
+ # config.api_key_prefix['Api-Secret'] = 'Bearer'
807
+ end
808
+
809
+ api_instance = Ifeelgoods::RedemptionsApi.new
810
+ redemption_id = 'redemption_id_example' # String | The redemption identifier
811
+
812
+ begin
813
+ # Refund
814
+ result = api_instance.refund_redemption(redemption_id)
815
+ p result
816
+ rescue Ifeelgoods::ApiError => e
817
+ puts "Error when calling RedemptionsApi->refund_redemption: #{e}"
818
+ end
819
+ ```
820
+
821
+ #### Using the refund_redemption_with_http_info variant
822
+
823
+ This returns an Array which contains the response data, status code and headers.
824
+
825
+ > <Array(<CreateRedemption201Response>, Integer, Hash)> refund_redemption_with_http_info(redemption_id)
826
+
827
+ ```ruby
828
+ begin
829
+ # Refund
830
+ data, status_code, headers = api_instance.refund_redemption_with_http_info(redemption_id)
831
+ p status_code # => 2xx
832
+ p headers # => { ... }
833
+ p data # => <CreateRedemption201Response>
834
+ rescue Ifeelgoods::ApiError => e
835
+ puts "Error when calling RedemptionsApi->refund_redemption_with_http_info: #{e}"
836
+ end
837
+ ```
838
+
839
+ ### Parameters
840
+
841
+ | Name | Type | Description | Notes |
842
+ | ---- | ---- | ----------- | ----- |
843
+ | **redemption_id** | **String** | The redemption identifier | |
844
+
845
+ ### Return type
846
+
847
+ [**CreateRedemption201Response**](CreateRedemption201Response.md)
848
+
849
+ ### Authorization
850
+
851
+ [api_key](../README.md#api_key), [bearer_auth](../README.md#bearer_auth), [api_secret](../README.md#api_secret)
852
+
853
+ ### HTTP request headers
854
+
855
+ - **Content-Type**: Not defined
856
+ - **Accept**: application/json, application/pdf
857
+