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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +81 -0
- data/README.md +167 -0
- data/Rakefile +10 -0
- data/docs/Account.md +34 -0
- data/docs/AccountsApi.md +84 -0
- data/docs/ActivateRedemptionRequest.md +18 -0
- data/docs/ActivateRedemptionRequestData.md +18 -0
- data/docs/Address.md +32 -0
- data/docs/BrandSummary.md +24 -0
- data/docs/BudgetLineItem.md +30 -0
- data/docs/CardConsultRedemption200Response.md +18 -0
- data/docs/CardConsultRedemption200ResponseData.md +20 -0
- data/docs/CardConsultRedemption422Response.md +20 -0
- data/docs/ClientDetails.md +40 -0
- data/docs/ClientSummary.md +40 -0
- data/docs/ClientSummaryBudgetAlerts.md +20 -0
- data/docs/ClientsApi.md +341 -0
- data/docs/CreateAndRedeemRequest.md +18 -0
- data/docs/CreateAndRedeemRequestData.md +24 -0
- data/docs/CreateRedemption201Response.md +18 -0
- data/docs/CreateRedemption422Response.md +20 -0
- data/docs/CreateRedemptionRequest.md +18 -0
- data/docs/CreateRedemptionRequestData.md +26 -0
- data/docs/CreateRedemptionRequestDataCustomization.md +18 -0
- data/docs/CreateRedemptionRequestDataCustomizationPdf.md +20 -0
- data/docs/CreateRedemptionRequestDataReward.md +18 -0
- data/docs/CreateRedemptionRequestDataValue.md +18 -0
- data/docs/Dimension.md +44 -0
- data/docs/DimensionDenomination.md +49 -0
- data/docs/DiscountSummary.md +28 -0
- data/docs/ErrorResponse.md +20 -0
- data/docs/GetClientBudgetHistory200Response.md +20 -0
- data/docs/GetClientById200Response.md +18 -0
- data/docs/GetCurrentAccount200Response.md +18 -0
- data/docs/GetPromotionByID200Response.md +18 -0
- data/docs/GetPromotionByID401Response.md +20 -0
- data/docs/GetPromotionByID404Response.md +20 -0
- data/docs/GetRedemptionStats200Response.md +20 -0
- data/docs/GetRewardBySKU200Response.md +18 -0
- data/docs/ListClientDiscounts200Response.md +20 -0
- data/docs/ListClientPromotions200Response.md +20 -0
- data/docs/ListClientPromotions200ResponsePaging.md +22 -0
- data/docs/ListClientPromotions401Response.md +20 -0
- data/docs/ListClientVendorPlaces200Response.md +20 -0
- data/docs/ListClients200Response.md +20 -0
- data/docs/ListRedemptions200Response.md +20 -0
- data/docs/ListRewards200Response.md +20 -0
- data/docs/ProductSummary.md +26 -0
- data/docs/ProductType.md +20 -0
- data/docs/PromotionDetails.md +46 -0
- data/docs/PromotionDetailsClient.md +20 -0
- data/docs/PromotionDetailsRewardsInner.md +28 -0
- data/docs/PromotionsApi.md +173 -0
- data/docs/Redemption.md +58 -0
- data/docs/RedemptionPromotion.md +24 -0
- data/docs/RedemptionReward.md +24 -0
- data/docs/RedemptionRewardFormat.md +20 -0
- data/docs/RedemptionValue.md +20 -0
- data/docs/RedemptionsApi.md +857 -0
- data/docs/RewardDetails.md +76 -0
- data/docs/RewardDetailsBrand.md +24 -0
- data/docs/RewardDetailsDimensions.md +44 -0
- data/docs/RewardDetailsProduct.md +26 -0
- data/docs/RewardDetailsProductType.md +20 -0
- data/docs/RewardDetailsTargeting.md +22 -0
- data/docs/RewardFormat.md +20 -0
- data/docs/RewardsApi.md +175 -0
- data/docs/Stats.md +20 -0
- data/docs/StatsApi.md +101 -0
- data/docs/StatsTimeframe.md +20 -0
- data/docs/StatsValuesInner.md +24 -0
- data/docs/StatsValuesInnerGroupByInner.md +26 -0
- data/docs/StatsValuesInnerStates.md +34 -0
- data/docs/User.md +26 -0
- data/docs/VendorPlace.md +26 -0
- data/docs/VendorPlaceBrand.md +20 -0
- data/docs/VendorPlaceGeoloc.md +20 -0
- data/docs/VendorPlacesApi.md +97 -0
- data/git_push.sh +57 -0
- data/ifeelgoods.gemspec +39 -0
- data/lib/ifeelgoods/api/accounts_api.rb +79 -0
- data/lib/ifeelgoods/api/clients_api.rb +318 -0
- data/lib/ifeelgoods/api/promotions_api.rb +166 -0
- data/lib/ifeelgoods/api/redemptions_api.rb +762 -0
- data/lib/ifeelgoods/api/rewards_api.rb +166 -0
- data/lib/ifeelgoods/api/stats_api.rb +111 -0
- data/lib/ifeelgoods/api/vendor_places_api.rb +109 -0
- data/lib/ifeelgoods/api_client.rb +397 -0
- data/lib/ifeelgoods/api_error.rb +58 -0
- data/lib/ifeelgoods/api_model_base.rb +88 -0
- data/lib/ifeelgoods/configuration.rb +332 -0
- data/lib/ifeelgoods/models/account.rb +260 -0
- data/lib/ifeelgoods/models/activate_redemption_request.rb +164 -0
- data/lib/ifeelgoods/models/activate_redemption_request_data.rb +147 -0
- data/lib/ifeelgoods/models/address.rb +219 -0
- data/lib/ifeelgoods/models/brand_summary.rb +212 -0
- data/lib/ifeelgoods/models/budget_line_item.rb +249 -0
- data/lib/ifeelgoods/models/card_consult_redemption200_response.rb +147 -0
- data/lib/ifeelgoods/models/card_consult_redemption200_response_data.rb +158 -0
- data/lib/ifeelgoods/models/card_consult_redemption422_response.rb +157 -0
- data/lib/ifeelgoods/models/client_details.rb +287 -0
- data/lib/ifeelgoods/models/client_summary.rb +287 -0
- data/lib/ifeelgoods/models/client_summary_budget_alerts.rb +159 -0
- data/lib/ifeelgoods/models/create_and_redeem_request.rb +164 -0
- data/lib/ifeelgoods/models/create_and_redeem_request_data.rb +174 -0
- data/lib/ifeelgoods/models/create_redemption201_response.rb +147 -0
- data/lib/ifeelgoods/models/create_redemption422_response.rb +157 -0
- data/lib/ifeelgoods/models/create_redemption_request.rb +164 -0
- data/lib/ifeelgoods/models/create_redemption_request_data.rb +235 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_customization.rb +147 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_customization_pdf.rb +157 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_reward.rb +147 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_value.rb +148 -0
- data/lib/ifeelgoods/models/dimension.rb +293 -0
- data/lib/ifeelgoods/models/dimension_denomination.rb +105 -0
- data/lib/ifeelgoods/models/discount_summary.rb +195 -0
- data/lib/ifeelgoods/models/error_response.rb +157 -0
- data/lib/ifeelgoods/models/get_client_budget_history200_response.rb +158 -0
- data/lib/ifeelgoods/models/get_client_by_id200_response.rb +147 -0
- data/lib/ifeelgoods/models/get_current_account200_response.rb +147 -0
- data/lib/ifeelgoods/models/get_promotion_by_id200_response.rb +147 -0
- data/lib/ifeelgoods/models/get_promotion_by_id401_response.rb +157 -0
- data/lib/ifeelgoods/models/get_promotion_by_id404_response.rb +157 -0
- data/lib/ifeelgoods/models/get_redemption_stats200_response.rb +158 -0
- data/lib/ifeelgoods/models/get_reward_by_sku200_response.rb +147 -0
- data/lib/ifeelgoods/models/list_client_discounts200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_client_promotions200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_client_promotions200_response_paging.rb +165 -0
- data/lib/ifeelgoods/models/list_client_promotions401_response.rb +157 -0
- data/lib/ifeelgoods/models/list_client_vendor_places200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_clients200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_redemptions200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_rewards200_response.rb +158 -0
- data/lib/ifeelgoods/models/product_summary.rb +222 -0
- data/lib/ifeelgoods/models/product_type.rb +204 -0
- data/lib/ifeelgoods/models/promotion_details.rb +354 -0
- data/lib/ifeelgoods/models/promotion_details_client.rb +157 -0
- data/lib/ifeelgoods/models/promotion_details_rewards_inner.rb +245 -0
- data/lib/ifeelgoods/models/redemption.rb +383 -0
- data/lib/ifeelgoods/models/redemption_promotion.rb +211 -0
- data/lib/ifeelgoods/models/redemption_reward.rb +224 -0
- data/lib/ifeelgoods/models/redemption_reward_format.rb +193 -0
- data/lib/ifeelgoods/models/redemption_value.rb +157 -0
- data/lib/ifeelgoods/models/reward_details.rb +486 -0
- data/lib/ifeelgoods/models/reward_details_brand.rb +213 -0
- data/lib/ifeelgoods/models/reward_details_dimensions.rb +293 -0
- data/lib/ifeelgoods/models/reward_details_product.rb +222 -0
- data/lib/ifeelgoods/models/reward_details_product_type.rb +204 -0
- data/lib/ifeelgoods/models/reward_details_targeting.rb +170 -0
- data/lib/ifeelgoods/models/reward_format.rb +192 -0
- data/lib/ifeelgoods/models/stats.rb +158 -0
- data/lib/ifeelgoods/models/stats_timeframe.rb +156 -0
- data/lib/ifeelgoods/models/stats_values_inner.rb +178 -0
- data/lib/ifeelgoods/models/stats_values_inner_group_by_inner.rb +186 -0
- data/lib/ifeelgoods/models/stats_values_inner_states.rb +219 -0
- data/lib/ifeelgoods/models/user.rb +188 -0
- data/lib/ifeelgoods/models/vendor_place.rb +186 -0
- data/lib/ifeelgoods/models/vendor_place_brand.rb +158 -0
- data/lib/ifeelgoods/models/vendor_place_geoloc.rb +156 -0
- data/lib/ifeelgoods/version.rb +15 -0
- data/lib/ifeelgoods.rb +115 -0
- data/spec/api/accounts_api_spec.rb +46 -0
- data/spec/api/clients_api_spec.rb +88 -0
- data/spec/api/promotions_api_spec.rb +61 -0
- data/spec/api/redemptions_api_spec.rb +175 -0
- data/spec/api/rewards_api_spec.rb +62 -0
- data/spec/api/stats_api_spec.rb +53 -0
- data/spec/api/vendor_places_api_spec.rb +51 -0
- data/spec/models/account_spec.rb +88 -0
- data/spec/models/activate_redemption_request_data_spec.rb +36 -0
- data/spec/models/activate_redemption_request_spec.rb +36 -0
- data/spec/models/address_spec.rb +78 -0
- data/spec/models/brand_summary_spec.rb +58 -0
- data/spec/models/budget_line_item_spec.rb +80 -0
- data/spec/models/card_consult_redemption200_response_data_spec.rb +42 -0
- data/spec/models/card_consult_redemption200_response_spec.rb +36 -0
- data/spec/models/card_consult_redemption422_response_spec.rb +42 -0
- data/spec/models/client_details_spec.rb +106 -0
- data/spec/models/client_summary_budget_alerts_spec.rb +42 -0
- data/spec/models/client_summary_spec.rb +106 -0
- data/spec/models/create_and_redeem_request_data_spec.rb +54 -0
- data/spec/models/create_and_redeem_request_spec.rb +36 -0
- data/spec/models/create_redemption201_response_spec.rb +36 -0
- data/spec/models/create_redemption422_response_spec.rb +42 -0
- data/spec/models/create_redemption_request_data_customization_pdf_spec.rb +42 -0
- data/spec/models/create_redemption_request_data_customization_spec.rb +36 -0
- data/spec/models/create_redemption_request_data_reward_spec.rb +36 -0
- data/spec/models/create_redemption_request_data_spec.rb +60 -0
- data/spec/models/create_redemption_request_data_value_spec.rb +36 -0
- data/spec/models/create_redemption_request_spec.rb +36 -0
- data/spec/models/dimension_denomination_spec.rb +32 -0
- data/spec/models/dimension_spec.rb +114 -0
- data/spec/models/discount_summary_spec.rb +66 -0
- data/spec/models/error_response_spec.rb +42 -0
- data/spec/models/get_client_budget_history200_response_spec.rb +42 -0
- data/spec/models/get_client_by_id200_response_spec.rb +36 -0
- data/spec/models/get_current_account200_response_spec.rb +36 -0
- data/spec/models/get_promotion_by_id200_response_spec.rb +36 -0
- data/spec/models/get_promotion_by_id401_response_spec.rb +42 -0
- data/spec/models/get_promotion_by_id404_response_spec.rb +42 -0
- data/spec/models/get_redemption_stats200_response_spec.rb +42 -0
- data/spec/models/get_reward_by_sku200_response_spec.rb +36 -0
- data/spec/models/list_client_discounts200_response_spec.rb +42 -0
- data/spec/models/list_client_promotions200_response_paging_spec.rb +48 -0
- data/spec/models/list_client_promotions200_response_spec.rb +42 -0
- data/spec/models/list_client_promotions401_response_spec.rb +42 -0
- data/spec/models/list_client_vendor_places200_response_spec.rb +42 -0
- data/spec/models/list_clients200_response_spec.rb +42 -0
- data/spec/models/list_redemptions200_response_spec.rb +42 -0
- data/spec/models/list_rewards200_response_spec.rb +42 -0
- data/spec/models/product_summary_spec.rb +64 -0
- data/spec/models/product_type_spec.rb +50 -0
- data/spec/models/promotion_details_client_spec.rb +42 -0
- data/spec/models/promotion_details_rewards_inner_spec.rb +78 -0
- data/spec/models/promotion_details_spec.rb +136 -0
- data/spec/models/redemption_promotion_spec.rb +58 -0
- data/spec/models/redemption_reward_format_spec.rb +50 -0
- data/spec/models/redemption_reward_spec.rb +62 -0
- data/spec/models/redemption_spec.rb +168 -0
- data/spec/models/redemption_value_spec.rb +42 -0
- data/spec/models/reward_details_brand_spec.rb +58 -0
- data/spec/models/reward_details_dimensions_spec.rb +114 -0
- data/spec/models/reward_details_product_spec.rb +64 -0
- data/spec/models/reward_details_product_type_spec.rb +50 -0
- data/spec/models/reward_details_spec.rb +218 -0
- data/spec/models/reward_details_targeting_spec.rb +48 -0
- data/spec/models/reward_format_spec.rb +50 -0
- data/spec/models/stats_spec.rb +42 -0
- data/spec/models/stats_timeframe_spec.rb +42 -0
- data/spec/models/stats_values_inner_group_by_inner_spec.rb +60 -0
- data/spec/models/stats_values_inner_spec.rb +54 -0
- data/spec/models/stats_values_inner_states_spec.rb +84 -0
- data/spec/models/user_spec.rb +60 -0
- data/spec/models/vendor_place_brand_spec.rb +42 -0
- data/spec/models/vendor_place_geoloc_spec.rb +42 -0
- data/spec/models/vendor_place_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- 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. `pending`, `redeemed`, `canceled`, etc.) | [optional] |
|
|
673
|
+
| **redeemed_datetime_start** | **Time** | Filter redemptions redeemed on or after this datetime (ISO 8601 format, e.g. `2024-01-01T00:00:00Z`) | [optional] |
|
|
674
|
+
| **redeemed_datetime_end** | **Time** | Filter redemptions redeemed on or before this datetime (ISO 8601 format, e.g. `2024-01-31T23:59:59Z`) | [optional] |
|
|
675
|
+
| **activation_datetime_start** | **Time** | Filter redemptions activated on or after this datetime (ISO 8601 format, e.g. `2024-01-01T00:00:00Z`) | [optional] |
|
|
676
|
+
| **activation_datetime_end** | **Time** | Filter redemptions activated on or before this datetime (ISO 8601 format, e.g. `2024-01-31T23:59:59Z`) | [optional] |
|
|
677
|
+
| **refund_datetime_start** | **Time** | Filter redemptions refunded on or after this datetime (ISO 8601 format, e.g. `2024-01-01T00:00:00Z`) | [optional] |
|
|
678
|
+
| **refund_datetime_end** | **Time** | Filter redemptions refunded on or before this datetime (ISO 8601 format, e.g. `2024-01-31T23:59:59Z`) | [optional] |
|
|
679
|
+
| **sort** | **String** | Field to sort by, prefixed with `-` for descending order (e.g. `activation_datetime` or `-activation_datetime`) | [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
|
+
|