tremendous_ruby 5.25.0 → 5.28.0
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 +4 -4
- data/lib/tremendous/api/tremendous_api.rb +163 -9
- data/lib/tremendous/api_client.rb +3 -2
- data/lib/tremendous/configuration.rb +10 -0
- data/lib/tremendous/models/campaign.rb +3 -5
- data/lib/tremendous/models/campaign_base.rb +3 -5
- data/lib/tremendous/models/connected_organization_member_member.rb +6 -4
- data/lib/tremendous/models/connected_organization_member_session.rb +27 -1
- data/lib/tremendous/models/connected_organization_organization.rb +3 -5
- data/lib/tremendous/models/{generate_reward_token200_response_reward.rb → create_api_key_request.rb} +51 -53
- data/lib/tremendous/models/create_campaign_request.rb +3 -5
- data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +27 -1
- data/lib/tremendous/models/create_connected_organization_member_session_request.rb +33 -4
- data/lib/tremendous/models/create_connected_organization_request.rb +13 -4
- data/lib/tremendous/models/{create_report201_response_report.rb → create_connected_organization_request_kyb_prefill.rb} +102 -81
- data/lib/tremendous/models/create_field.rb +6 -4
- data/lib/tremendous/models/create_field_request.rb +6 -4
- data/lib/tremendous/models/create_invoice_request.rb +6 -10
- data/lib/tremendous/models/create_order200_response_order.rb +9 -9
- data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +12 -8
- data/lib/tremendous/models/create_report200_response_report.rb +3 -5
- data/lib/tremendous/models/create_report_request.rb +12 -8
- data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +6 -10
- data/lib/tremendous/models/delivery_details.rb +6 -10
- data/lib/tremendous/models/delivery_details_with_link.rb +12 -8
- data/lib/tremendous/models/field.rb +3 -5
- data/lib/tremendous/models/fraud_config_country.rb +6 -4
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +6 -4
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +6 -4
- data/lib/tremendous/models/{create_campaign201_response.rb → fraud_config_review_vpn.rb} +21 -19
- data/lib/tremendous/models/fraud_review.rb +10 -16
- data/lib/tremendous/models/fraud_review_base.rb +7 -11
- data/lib/tremendous/models/fraud_review_list_item.rb +7 -11
- data/lib/tremendous/models/fraud_review_reason.rb +2 -1
- data/lib/tremendous/models/fraud_rule_request_config.rb +2 -1
- data/lib/tremendous/models/fraud_rules_list_item.rb +4 -6
- data/lib/tremendous/models/funding_source.rb +12 -14
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +10 -16
- data/lib/tremendous/models/get_member200_response_member.rb +6 -4
- data/lib/tremendous/models/get_member200_response_member_events_inner.rb +3 -5
- data/lib/tremendous/models/invoice.rb +12 -14
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +3 -5
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +6 -4
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +3 -5
- data/lib/tremendous/models/list_fields200_response_fields_inner.rb +3 -5
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +7 -11
- data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +4 -6
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +12 -14
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +6 -10
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +12 -14
- data/lib/tremendous/models/list_members200_response_members_inner.rb +6 -4
- data/lib/tremendous/models/list_orders200_response_orders_inner.rb +9 -9
- data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +3 -5
- data/lib/tremendous/models/list_products_response_products_inner.rb +11 -11
- data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +6 -4
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +6 -10
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +3 -5
- data/lib/tremendous/models/member.rb +6 -4
- data/lib/tremendous/models/member_base.rb +6 -4
- data/lib/tremendous/models/member_with_events.rb +6 -4
- data/lib/tremendous/models/member_without_events.rb +6 -4
- data/lib/tremendous/models/order.rb +9 -9
- data/lib/tremendous/models/order_base.rb +9 -9
- data/lib/tremendous/models/order_with_link.rb +9 -9
- data/lib/tremendous/models/order_without_link.rb +9 -9
- data/lib/tremendous/models/organization.rb +3 -5
- data/lib/tremendous/models/payout.rb +3 -5
- data/lib/tremendous/models/product.rb +11 -11
- data/lib/tremendous/models/report.rb +3 -5
- data/lib/tremendous/models/review_country.rb +6 -4
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +6 -4
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +6 -4
- data/lib/tremendous/models/{generate_reward_token200_response.rb → review_vpn.rb} +22 -19
- data/lib/tremendous/models/reward_value.rb +3 -5
- data/lib/tremendous/models/reward_with_link_delivery.rb +12 -8
- data/lib/tremendous/models/reward_without_link_delivery.rb +6 -10
- data/lib/tremendous/models/single_reward_order_reward_delivery.rb +3 -5
- data/lib/tremendous/models/single_reward_order_with_link_order.rb +9 -9
- data/lib/tremendous/models/single_reward_order_without_link_order.rb +9 -9
- data/lib/tremendous/models/update_campaign.rb +3 -5
- data/lib/tremendous/models/update_campaign_request.rb +3 -5
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +6 -4
- data/lib/tremendous/models/{get_fraud_review200_response_fraud_review_geo.rb → update_member.rb} +28 -32
- data/lib/tremendous/models/{create_report201_response.rb → update_member_request.rb} +34 -27
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +6 -0
- metadata +21 -8
- data/lib/tremendous/models/create_order201_response.rb +0 -221
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cf8894fe6420ba69fb8646b811b2198640b9b66f3cc1e5f701e58c099bb6db4
|
|
4
|
+
data.tar.gz: 8c4f5c9486cf9cd0cf7d37e514e32c15426ef2f8d631567b2a5f46881fdd3b62
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11611150c062fa61d15fd3b56dc26e4a907d8af2f3fa42ffe7f354eade0337f7a578ac66ea86cbb0f28f49083ad581f77f6d8e6ee577e10793cb415ae4e845a8
|
|
7
|
+
data.tar.gz: 72c5d3e03306949c4f014fb4dcd7991a4ffffde0cee3d1980c08502508d64700c9fca6aec49353bd9c0af98ccba6e5860ab9e6a3e7ed47a58c79450419dc084f
|
|
@@ -151,7 +151,7 @@ module Tremendous
|
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
# Cancel reward
|
|
154
|
-
# Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled.
|
|
154
|
+
# Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled. Rewards that have already been redeemed cannot be canceled: the request fails with a `422` error and the reward is left unchanged.
|
|
155
155
|
# @param id [String] ID of the reward that should be canceled
|
|
156
156
|
# @param [Hash] opts the optional parameters
|
|
157
157
|
# @return [Object]
|
|
@@ -161,7 +161,7 @@ module Tremendous
|
|
|
161
161
|
end
|
|
162
162
|
|
|
163
163
|
# Cancel reward
|
|
164
|
-
# Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled.
|
|
164
|
+
# Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled. Rewards that have already been redeemed cannot be canceled: the request fails with a `422` error and the reward is left unchanged.
|
|
165
165
|
# @param id [String] ID of the reward that should be canceled
|
|
166
166
|
# @param [Hash] opts the optional parameters
|
|
167
167
|
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
@@ -221,6 +221,7 @@ module Tremendous
|
|
|
221
221
|
# Create API key
|
|
222
222
|
# Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
223
223
|
# @param [Hash] opts the optional parameters
|
|
224
|
+
# @option opts [CreateApiKeyRequest] :create_api_key_request Optional settings for the new API key
|
|
224
225
|
# @return [CreateApiKey200Response]
|
|
225
226
|
def create_api_key(opts = {})
|
|
226
227
|
data, _status_code, _headers = create_api_key_with_http_info(opts)
|
|
@@ -230,6 +231,7 @@ module Tremendous
|
|
|
230
231
|
# Create API key
|
|
231
232
|
# Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
232
233
|
# @param [Hash] opts the optional parameters
|
|
234
|
+
# @option opts [CreateApiKeyRequest] :create_api_key_request Optional settings for the new API key
|
|
233
235
|
# @return [Array<(CreateApiKey200Response, Integer, Hash)>] CreateApiKey200Response data, response status code and response headers
|
|
234
236
|
def create_api_key_with_http_info(opts = {})
|
|
235
237
|
if @api_client.config.debugging
|
|
@@ -245,12 +247,17 @@ module Tremendous
|
|
|
245
247
|
header_params = opts[:header_params] || {}
|
|
246
248
|
# HTTP header 'Accept' (if needed)
|
|
247
249
|
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
250
|
+
# HTTP header 'Content-Type'
|
|
251
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
252
|
+
if !content_type.nil?
|
|
253
|
+
header_params['Content-Type'] = content_type
|
|
254
|
+
end
|
|
248
255
|
|
|
249
256
|
# form parameters
|
|
250
257
|
form_params = opts[:form_params] || {}
|
|
251
258
|
|
|
252
259
|
# http body (model)
|
|
253
|
-
post_body = opts[:debug_body]
|
|
260
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_api_key_request'])
|
|
254
261
|
|
|
255
262
|
# return_type
|
|
256
263
|
return_type = opts[:debug_return_type] || 'CreateApiKey200Response'
|
|
@@ -342,7 +349,7 @@ module Tremendous
|
|
|
342
349
|
end
|
|
343
350
|
|
|
344
351
|
# Create connected organization
|
|
345
|
-
# Create a connected organization.
|
|
352
|
+
# Create a connected organization. Optionally pass a `kyb_prefill` object to forward KYB (Know Your Business) details you have already collected for the end client. When provided, these values prefill the end client's onboarding form; the end client still reviews, edits where needed, and submits the form. Every `kyb_prefill` field is optional, but any value provided is validated. Malformed KYB details (for example an unsupported `country_code` or a malformed `website_url`) return a `400`.
|
|
346
353
|
# @param create_connected_organization_request [CreateConnectedOrganizationRequest] Connected organization to create
|
|
347
354
|
# @param [Hash] opts the optional parameters
|
|
348
355
|
# @return [CreateConnectedOrganization200Response]
|
|
@@ -352,7 +359,7 @@ module Tremendous
|
|
|
352
359
|
end
|
|
353
360
|
|
|
354
361
|
# Create connected organization
|
|
355
|
-
# Create a connected organization.
|
|
362
|
+
# Create a connected organization. Optionally pass a `kyb_prefill` object to forward KYB (Know Your Business) details you have already collected for the end client. When provided, these values prefill the end client's onboarding form; the end client still reviews, edits where needed, and submits the form. Every `kyb_prefill` field is optional, but any value provided is validated. Malformed KYB details (for example an unsupported `country_code` or a malformed `website_url`) return a `400`.
|
|
356
363
|
# @param create_connected_organization_request [CreateConnectedOrganizationRequest] Connected organization to create
|
|
357
364
|
# @param [Hash] opts the optional parameters
|
|
358
365
|
# @return [Array<(CreateConnectedOrganization200Response, Integer, Hash)>] CreateConnectedOrganization200Response data, response status code and response headers
|
|
@@ -756,7 +763,7 @@ module Tremendous
|
|
|
756
763
|
end
|
|
757
764
|
|
|
758
765
|
# Create order
|
|
759
|
-
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">expires_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward. Defaults to the organization's currency if not provided.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The initial <code>POST /orders</code> response for a link reward includes the link in <code>delivery.link</code>.</p> <p>The link must then be delivered to the recipient out-of-band.</p> <p>To obtain a new link for an existing reward, call <code>POST /rewards/{id}/generate_link</code>.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
766
|
+
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">expires_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward. Defaults to the organization's currency if not provided.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The initial <code>POST /orders</code> response for a link reward includes the link in <code>delivery.link</code>.</p> <p>The link must then be delivered to the recipient out-of-band.</p> <p>To obtain a new link for an existing reward, call <code>POST /rewards/{id}/generate_link</code>.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $100,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
760
767
|
# @param create_order_request [CreateOrderRequest] Order to create
|
|
761
768
|
# @param [Hash] opts the optional parameters
|
|
762
769
|
# @return [CreateOrder200Response]
|
|
@@ -766,7 +773,7 @@ module Tremendous
|
|
|
766
773
|
end
|
|
767
774
|
|
|
768
775
|
# Create order
|
|
769
|
-
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">expires_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward. Defaults to the organization&#39;s currency if not provided.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The initial <code>POST /orders</code> response for a link reward includes the link in <code>delivery.link</code>.</p> <p>The link must then be delivered to the recipient out-of-band.</p> <p>To obtain a new link for an existing reward, call <code>POST /rewards/{id}/generate_link</code>.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
776
|
+
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">expires_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward. Defaults to the organization&#39;s currency if not provided.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The initial <code>POST /orders</code> response for a link reward includes the link in <code>delivery.link</code>.</p> <p>The link must then be delivered to the recipient out-of-band.</p> <p>To obtain a new link for an existing reward, call <code>POST /rewards/{id}/generate_link</code>.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $100,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
770
777
|
# @param create_order_request [CreateOrderRequest] Order to create
|
|
771
778
|
# @param [Hash] opts the optional parameters
|
|
772
779
|
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
|
@@ -1346,6 +1353,74 @@ module Tremendous
|
|
|
1346
1353
|
return data, status_code, headers
|
|
1347
1354
|
end
|
|
1348
1355
|
|
|
1356
|
+
# Delete member
|
|
1357
|
+
# Removes an existing member from the organization, identified by the given `id` in the URL. The member loses access to the organization and a `MEMBERS.DELETED` webhook event is emitted.
|
|
1358
|
+
# @param id [String] ID of the member to delete
|
|
1359
|
+
# @param [Hash] opts the optional parameters
|
|
1360
|
+
# @return [nil]
|
|
1361
|
+
def delete_member(id, opts = {})
|
|
1362
|
+
delete_member_with_http_info(id, opts)
|
|
1363
|
+
nil
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
|
+
# Delete member
|
|
1367
|
+
# Removes an existing member from the organization, identified by the given `id` in the URL. The member loses access to the organization and a `MEMBERS.DELETED` webhook event is emitted.
|
|
1368
|
+
# @param id [String] ID of the member to delete
|
|
1369
|
+
# @param [Hash] opts the optional parameters
|
|
1370
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
1371
|
+
def delete_member_with_http_info(id, opts = {})
|
|
1372
|
+
if @api_client.config.debugging
|
|
1373
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.delete_member ...'
|
|
1374
|
+
end
|
|
1375
|
+
# verify the required parameter 'id' is set
|
|
1376
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1377
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_member"
|
|
1378
|
+
end
|
|
1379
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
1380
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
1381
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_member, must conform to the pattern #{pattern}."
|
|
1382
|
+
end
|
|
1383
|
+
|
|
1384
|
+
# resource path
|
|
1385
|
+
local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1386
|
+
|
|
1387
|
+
# query parameters
|
|
1388
|
+
query_params = opts[:query_params] || {}
|
|
1389
|
+
|
|
1390
|
+
# header parameters
|
|
1391
|
+
header_params = opts[:header_params] || {}
|
|
1392
|
+
# HTTP header 'Accept' (if needed)
|
|
1393
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1394
|
+
|
|
1395
|
+
# form parameters
|
|
1396
|
+
form_params = opts[:form_params] || {}
|
|
1397
|
+
|
|
1398
|
+
# http body (model)
|
|
1399
|
+
post_body = opts[:debug_body]
|
|
1400
|
+
|
|
1401
|
+
# return_type
|
|
1402
|
+
return_type = opts[:debug_return_type]
|
|
1403
|
+
|
|
1404
|
+
# auth_names
|
|
1405
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
1406
|
+
|
|
1407
|
+
new_options = opts.merge(
|
|
1408
|
+
:operation => :"TremendousApi.delete_member",
|
|
1409
|
+
:header_params => header_params,
|
|
1410
|
+
:query_params => query_params,
|
|
1411
|
+
:form_params => form_params,
|
|
1412
|
+
:body => post_body,
|
|
1413
|
+
:auth_names => auth_names,
|
|
1414
|
+
:return_type => return_type
|
|
1415
|
+
)
|
|
1416
|
+
|
|
1417
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
1418
|
+
if @api_client.config.debugging
|
|
1419
|
+
@api_client.config.logger.debug "API called: TremendousApi#delete_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1420
|
+
end
|
|
1421
|
+
return data, status_code, headers
|
|
1422
|
+
end
|
|
1423
|
+
|
|
1349
1424
|
# Delete webhook
|
|
1350
1425
|
# > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
1351
1426
|
# @param id [String] ID of the webhook to delete
|
|
@@ -1544,7 +1619,7 @@ module Tremendous
|
|
|
1544
1619
|
# Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.
|
|
1545
1620
|
# @param rule_type [String] The rule type to create or update.
|
|
1546
1621
|
# @param [Hash] opts the optional parameters
|
|
1547
|
-
# @option opts [FraudRuleRequest] :fraud_rule_request Rules `review_multiple_emails`, `
|
|
1622
|
+
# @option opts [FraudRuleRequest] :fraud_rule_request Rules `review_multiple_emails`, `review_tremendous_flaglist`, and `review_previously_blocked_recipients` require no body. `review_vpn` also accepts no body for the default behavior. Pass `config.skip_apple_private_relay` only to override whether Apple Private Relay traffic is flagged.
|
|
1548
1623
|
# @return [FraudRule200Response]
|
|
1549
1624
|
def fraud_rule(rule_type, opts = {})
|
|
1550
1625
|
data, _status_code, _headers = fraud_rule_with_http_info(rule_type, opts)
|
|
@@ -1555,7 +1630,7 @@ module Tremendous
|
|
|
1555
1630
|
# Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.
|
|
1556
1631
|
# @param rule_type [String] The rule type to create or update.
|
|
1557
1632
|
# @param [Hash] opts the optional parameters
|
|
1558
|
-
# @option opts [FraudRuleRequest] :fraud_rule_request Rules `review_multiple_emails`, `
|
|
1633
|
+
# @option opts [FraudRuleRequest] :fraud_rule_request Rules `review_multiple_emails`, `review_tremendous_flaglist`, and `review_previously_blocked_recipients` require no body. `review_vpn` also accepts no body for the default behavior. Pass `config.skip_apple_private_relay` only to override whether Apple Private Relay traffic is flagged.
|
|
1559
1634
|
# @return [Array<(FraudRule200Response, Integer, Hash)>] FraudRule200Response data, response status code and response headers
|
|
1560
1635
|
def fraud_rule_with_http_info(rule_type, opts = {})
|
|
1561
1636
|
if @api_client.config.debugging
|
|
@@ -4248,5 +4323,84 @@ module Tremendous
|
|
|
4248
4323
|
end
|
|
4249
4324
|
return data, status_code, headers
|
|
4250
4325
|
end
|
|
4326
|
+
|
|
4327
|
+
# Update member
|
|
4328
|
+
# Updates the role of an existing member, identified by the given `id` in the URL. Check the Roles API for the roles available within the organization.
|
|
4329
|
+
# @param id [String] ID of the member to update
|
|
4330
|
+
# @param update_member_request [UpdateMemberRequest] Attributes to update on the member
|
|
4331
|
+
# @param [Hash] opts the optional parameters
|
|
4332
|
+
# @return [CreateMember200Response]
|
|
4333
|
+
def update_member(id, update_member_request, opts = {})
|
|
4334
|
+
data, _status_code, _headers = update_member_with_http_info(id, update_member_request, opts)
|
|
4335
|
+
data
|
|
4336
|
+
end
|
|
4337
|
+
|
|
4338
|
+
# Update member
|
|
4339
|
+
# Updates the role of an existing member, identified by the given `id` in the URL. Check the Roles API for the roles available within the organization.
|
|
4340
|
+
# @param id [String] ID of the member to update
|
|
4341
|
+
# @param update_member_request [UpdateMemberRequest] Attributes to update on the member
|
|
4342
|
+
# @param [Hash] opts the optional parameters
|
|
4343
|
+
# @return [Array<(CreateMember200Response, Integer, Hash)>] CreateMember200Response data, response status code and response headers
|
|
4344
|
+
def update_member_with_http_info(id, update_member_request, opts = {})
|
|
4345
|
+
if @api_client.config.debugging
|
|
4346
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.update_member ...'
|
|
4347
|
+
end
|
|
4348
|
+
# verify the required parameter 'id' is set
|
|
4349
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
4350
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_member"
|
|
4351
|
+
end
|
|
4352
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
4353
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
4354
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_member, must conform to the pattern #{pattern}."
|
|
4355
|
+
end
|
|
4356
|
+
|
|
4357
|
+
# verify the required parameter 'update_member_request' is set
|
|
4358
|
+
if @api_client.config.client_side_validation && update_member_request.nil?
|
|
4359
|
+
fail ArgumentError, "Missing the required parameter 'update_member_request' when calling TremendousApi.update_member"
|
|
4360
|
+
end
|
|
4361
|
+
# resource path
|
|
4362
|
+
local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
4363
|
+
|
|
4364
|
+
# query parameters
|
|
4365
|
+
query_params = opts[:query_params] || {}
|
|
4366
|
+
|
|
4367
|
+
# header parameters
|
|
4368
|
+
header_params = opts[:header_params] || {}
|
|
4369
|
+
# HTTP header 'Accept' (if needed)
|
|
4370
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
4371
|
+
# HTTP header 'Content-Type'
|
|
4372
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
4373
|
+
if !content_type.nil?
|
|
4374
|
+
header_params['Content-Type'] = content_type
|
|
4375
|
+
end
|
|
4376
|
+
|
|
4377
|
+
# form parameters
|
|
4378
|
+
form_params = opts[:form_params] || {}
|
|
4379
|
+
|
|
4380
|
+
# http body (model)
|
|
4381
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_member_request)
|
|
4382
|
+
|
|
4383
|
+
# return_type
|
|
4384
|
+
return_type = opts[:debug_return_type] || 'CreateMember200Response'
|
|
4385
|
+
|
|
4386
|
+
# auth_names
|
|
4387
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
4388
|
+
|
|
4389
|
+
new_options = opts.merge(
|
|
4390
|
+
:operation => :"TremendousApi.update_member",
|
|
4391
|
+
:header_params => header_params,
|
|
4392
|
+
:query_params => query_params,
|
|
4393
|
+
:form_params => form_params,
|
|
4394
|
+
:body => post_body,
|
|
4395
|
+
:auth_names => auth_names,
|
|
4396
|
+
:return_type => return_type
|
|
4397
|
+
)
|
|
4398
|
+
|
|
4399
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
4400
|
+
if @api_client.config.debugging
|
|
4401
|
+
@api_client.config.logger.debug "API called: TremendousApi#update_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
4402
|
+
end
|
|
4403
|
+
return data, status_code, headers
|
|
4404
|
+
end
|
|
4251
4405
|
end
|
|
4252
4406
|
end
|
|
@@ -17,6 +17,7 @@ require 'tempfile'
|
|
|
17
17
|
require 'time'
|
|
18
18
|
require 'faraday'
|
|
19
19
|
require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
|
|
20
|
+
require 'marcel'
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
module Tremendous
|
|
@@ -254,7 +255,7 @@ module Tremendous
|
|
|
254
255
|
# @param [String] mime MIME
|
|
255
256
|
# @return [Boolean] True if the MIME is application/json
|
|
256
257
|
def json_mime?(mime)
|
|
257
|
-
(mime == '*/*') || !(mime =~
|
|
258
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
|
258
259
|
end
|
|
259
260
|
|
|
260
261
|
# Deserialize the response to the given return type.
|
|
@@ -333,7 +334,7 @@ module Tremendous
|
|
|
333
334
|
# @param [String] filename the filename to be sanitized
|
|
334
335
|
# @return [String] the sanitized filename
|
|
335
336
|
def sanitize_filename(filename)
|
|
336
|
-
filename.
|
|
337
|
+
filename.split(/[\/\\]/).last
|
|
337
338
|
end
|
|
338
339
|
|
|
339
340
|
def build_request_url(path, opts = {})
|
|
@@ -82,6 +82,14 @@ module Tremendous
|
|
|
82
82
|
# @return [true, false]
|
|
83
83
|
attr_accessor :debugging
|
|
84
84
|
|
|
85
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
|
86
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
|
87
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
|
88
|
+
# `scheme`, `host`, `base_path` directly.
|
|
89
|
+
# Default to false.
|
|
90
|
+
# @return [true, false]
|
|
91
|
+
attr_accessor :ignore_operation_servers
|
|
92
|
+
|
|
85
93
|
# Defines the logger used for debugging.
|
|
86
94
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
|
87
95
|
#
|
|
@@ -173,6 +181,7 @@ module Tremendous
|
|
|
173
181
|
@return_binary_data = false
|
|
174
182
|
@params_encoder = nil
|
|
175
183
|
@debugging = false
|
|
184
|
+
@ignore_operation_servers = false
|
|
176
185
|
@inject_format = false
|
|
177
186
|
@force_ending_format = false
|
|
178
187
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
|
@@ -207,6 +216,7 @@ module Tremendous
|
|
|
207
216
|
|
|
208
217
|
# Returns base URL for specified operation based on server settings
|
|
209
218
|
def base_url(operation = nil)
|
|
219
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
|
210
220
|
if operation_server_settings.key?(operation) then
|
|
211
221
|
index = server_operation_index.fetch(operation, server_index)
|
|
212
222
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
|
@@ -230,13 +230,11 @@ module Tremendous
|
|
|
230
230
|
@products = products
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
-
# Custom attribute writer method
|
|
233
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
234
|
+
# so that enum values added to the API don't break deserialization on
|
|
235
|
+
# older versions of this gem.
|
|
234
236
|
# @param [Object] fee_charged_to Object to be assigned
|
|
235
237
|
def fee_charged_to=(fee_charged_to)
|
|
236
|
-
validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
|
|
237
|
-
unless validator.valid?(fee_charged_to)
|
|
238
|
-
fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
|
|
239
|
-
end
|
|
240
238
|
@fee_charged_to = fee_charged_to
|
|
241
239
|
end
|
|
242
240
|
|
|
@@ -194,13 +194,11 @@ module Tremendous
|
|
|
194
194
|
@id = id
|
|
195
195
|
end
|
|
196
196
|
|
|
197
|
-
# Custom attribute writer method
|
|
197
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
198
|
+
# so that enum values added to the API don't break deserialization on
|
|
199
|
+
# older versions of this gem.
|
|
198
200
|
# @param [Object] fee_charged_to Object to be assigned
|
|
199
201
|
def fee_charged_to=(fee_charged_to)
|
|
200
|
-
validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
|
|
201
|
-
unless validator.valid?(fee_charged_to)
|
|
202
|
-
fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
|
|
203
|
-
end
|
|
204
202
|
@fee_charged_to = fee_charged_to
|
|
205
203
|
end
|
|
206
204
|
|
|
@@ -228,13 +228,15 @@ module Tremendous
|
|
|
228
228
|
@email = email
|
|
229
229
|
end
|
|
230
230
|
|
|
231
|
-
# Custom attribute writer method
|
|
231
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
232
|
+
# so that enum values added to the API don't break deserialization on
|
|
233
|
+
# older versions of this gem.
|
|
232
234
|
# @param [Object] status Object to be assigned
|
|
233
235
|
def status=(status)
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
236
|
+
if status.nil?
|
|
237
|
+
fail ArgumentError, 'status cannot be nil'
|
|
237
238
|
end
|
|
239
|
+
|
|
238
240
|
@status = status
|
|
239
241
|
end
|
|
240
242
|
|