tremendous_ruby 5.0.1 → 5.3.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 +677 -9
- data/lib/tremendous/models/campaign.rb +25 -14
- data/lib/tremendous/models/campaign_base.rb +287 -0
- data/lib/tremendous/models/{get_campaign200_response.rb → create_campaign201_response.rb} +3 -3
- data/lib/tremendous/models/create_campaign_request.rb +273 -0
- data/lib/tremendous/models/create_member.rb +2 -53
- data/lib/tremendous/models/create_member_request.rb +2 -53
- data/lib/tremendous/models/create_order_request_reward.rb +1 -1
- data/lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb +248 -0
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +29 -5
- data/lib/tremendous/models/{list_products200_response_products_inner_countries_inner.rb → create_public_key.rb} +15 -15
- data/lib/tremendous/models/create_public_key200_response.rb +221 -0
- data/lib/tremendous/models/create_public_key_request.rb +222 -0
- data/lib/tremendous/models/custom_field.rb +15 -5
- data/lib/tremendous/models/get_member200_response_member.rb +13 -21
- data/lib/tremendous/models/invoice.rb +2 -2
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +25 -14
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +270 -0
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +270 -0
- data/lib/tremendous/models/{get_product200_response.rb → list_forex_response.rb} +16 -14
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +2 -2
- data/lib/tremendous/models/list_members200_response_members_inner.rb +13 -21
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +15 -5
- data/lib/tremendous/models/{list_products200_response.rb → list_roles200_response.rb} +15 -15
- data/lib/tremendous/models/{list_products200_response_products_inner_images_inner.rb → list_roles200_response_roles_inner.rb} +59 -57
- data/lib/tremendous/models/member.rb +13 -21
- data/lib/tremendous/models/member_base.rb +13 -21
- data/lib/tremendous/models/member_with_events.rb +13 -21
- data/lib/tremendous/models/member_without_events.rb +13 -21
- data/lib/tremendous/models/public_key.rb +257 -0
- data/lib/tremendous/models/public_keys_response.rb +223 -0
- data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +257 -0
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +15 -5
- data/lib/tremendous/models/{list_products200_response_products_inner_skus_inner.rb → role.rb} +51 -53
- data/lib/tremendous/models/test_public_key.rb +222 -0
- data/lib/tremendous/models/test_public_key_request.rb +222 -0
- data/lib/tremendous/models/update_campaign.rb +287 -0
- data/lib/tremendous/models/update_campaign_request.rb +257 -0
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +20 -1
- metadata +23 -10
- data/lib/tremendous/models/list_products200_response_products_inner.rb +0 -457
|
@@ -144,6 +144,72 @@ module Tremendous
|
|
|
144
144
|
return data, status_code, headers
|
|
145
145
|
end
|
|
146
146
|
|
|
147
|
+
# Create campaign
|
|
148
|
+
# @param create_campaign_request [CreateCampaignRequest] Campaign details
|
|
149
|
+
# @param [Hash] opts the optional parameters
|
|
150
|
+
# @return [CreateCampaign201Response]
|
|
151
|
+
def create_campaign(create_campaign_request, opts = {})
|
|
152
|
+
data, _status_code, _headers = create_campaign_with_http_info(create_campaign_request, opts)
|
|
153
|
+
data
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Create campaign
|
|
157
|
+
# @param create_campaign_request [CreateCampaignRequest] Campaign details
|
|
158
|
+
# @param [Hash] opts the optional parameters
|
|
159
|
+
# @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
|
|
160
|
+
def create_campaign_with_http_info(create_campaign_request, opts = {})
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.create_campaign ...'
|
|
163
|
+
end
|
|
164
|
+
# verify the required parameter 'create_campaign_request' is set
|
|
165
|
+
if @api_client.config.client_side_validation && create_campaign_request.nil?
|
|
166
|
+
fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.create_campaign"
|
|
167
|
+
end
|
|
168
|
+
# resource path
|
|
169
|
+
local_var_path = '/campaigns'
|
|
170
|
+
|
|
171
|
+
# query parameters
|
|
172
|
+
query_params = opts[:query_params] || {}
|
|
173
|
+
|
|
174
|
+
# header parameters
|
|
175
|
+
header_params = opts[:header_params] || {}
|
|
176
|
+
# HTTP header 'Accept' (if needed)
|
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
178
|
+
# HTTP header 'Content-Type'
|
|
179
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
180
|
+
if !content_type.nil?
|
|
181
|
+
header_params['Content-Type'] = content_type
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# form parameters
|
|
185
|
+
form_params = opts[:form_params] || {}
|
|
186
|
+
|
|
187
|
+
# http body (model)
|
|
188
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)
|
|
189
|
+
|
|
190
|
+
# return_type
|
|
191
|
+
return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
|
|
192
|
+
|
|
193
|
+
# auth_names
|
|
194
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
195
|
+
|
|
196
|
+
new_options = opts.merge(
|
|
197
|
+
:operation => :"TremendousApi.create_campaign",
|
|
198
|
+
:header_params => header_params,
|
|
199
|
+
:query_params => query_params,
|
|
200
|
+
:form_params => form_params,
|
|
201
|
+
:body => post_body,
|
|
202
|
+
:auth_names => auth_names,
|
|
203
|
+
:return_type => return_type
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
207
|
+
if @api_client.config.debugging
|
|
208
|
+
@api_client.config.logger.debug "API called: TremendousApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
209
|
+
end
|
|
210
|
+
return data, status_code, headers
|
|
211
|
+
end
|
|
212
|
+
|
|
147
213
|
# Create invoice
|
|
148
214
|
# Creating an invoice is the way for your organization to fund your account's balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account's balance ## 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\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
|
|
149
215
|
# @param create_invoice_request [CreateInvoiceRequest] Invoice details
|
|
@@ -213,7 +279,7 @@ module Tremendous
|
|
|
213
279
|
end
|
|
214
280
|
|
|
215
281
|
# Create member
|
|
216
|
-
# Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have
|
|
282
|
+
# Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
|
|
217
283
|
# @param create_member_request [CreateMemberRequest] Member details
|
|
218
284
|
# @param [Hash] opts the optional parameters
|
|
219
285
|
# @return [CreateMember200Response]
|
|
@@ -223,7 +289,7 @@ module Tremendous
|
|
|
223
289
|
end
|
|
224
290
|
|
|
225
291
|
# Create member
|
|
226
|
-
# Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have
|
|
292
|
+
# Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
|
|
227
293
|
# @param create_member_request [CreateMemberRequest] Member details
|
|
228
294
|
# @param [Hash] opts the optional parameters
|
|
229
295
|
# @return [Array<(CreateMember200Response, Integer, Hash)>] CreateMember200Response data, response status code and response headers
|
|
@@ -281,7 +347,7 @@ module Tremendous
|
|
|
281
347
|
end
|
|
282
348
|
|
|
283
349
|
# Create order
|
|
284
|
-
# 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-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</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> </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 link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></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://tremendous.readme.io/reference/core-funding-source-index). 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://tremendous.readme.io/reference/sandbox). 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 result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
350
|
+
# 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-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</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 link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></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://tremendous.readme.io/reference/core-funding-source-index). 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://tremendous.readme.io/reference/sandbox). 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 result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
285
351
|
# @param create_order_request [CreateOrderRequest] Order to create
|
|
286
352
|
# @param [Hash] opts the optional parameters
|
|
287
353
|
# @return [CreateOrder200Response]
|
|
@@ -291,7 +357,7 @@ module Tremendous
|
|
|
291
357
|
end
|
|
292
358
|
|
|
293
359
|
# Create order
|
|
294
|
-
# 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-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</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> </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 link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></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://tremendous.readme.io/reference/core-funding-source-index). 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://tremendous.readme.io/reference/sandbox). 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 result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
360
|
+
# 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-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</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 link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></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://tremendous.readme.io/reference/core-funding-source-index). 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://tremendous.readme.io/reference/sandbox). 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 result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
|
295
361
|
# @param create_order_request [CreateOrderRequest] Order to create
|
|
296
362
|
# @param [Hash] opts the optional parameters
|
|
297
363
|
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
|
@@ -416,6 +482,74 @@ module Tremendous
|
|
|
416
482
|
return data, status_code, headers
|
|
417
483
|
end
|
|
418
484
|
|
|
485
|
+
# Create public key
|
|
486
|
+
# Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub` <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\">public_key</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Base64 encoded (public) PEM file</p> </td></tr> </tbody> </table> </div>
|
|
487
|
+
# @param create_public_key_request [CreatePublicKeyRequest] Public key details
|
|
488
|
+
# @param [Hash] opts the optional parameters
|
|
489
|
+
# @return [CreatePublicKey200Response]
|
|
490
|
+
def create_public_key(create_public_key_request, opts = {})
|
|
491
|
+
data, _status_code, _headers = create_public_key_with_http_info(create_public_key_request, opts)
|
|
492
|
+
data
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
# Create public key
|
|
496
|
+
# Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub` <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\">public_key</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Base64 encoded (public) PEM file</p> </td></tr> </tbody> </table> </div>
|
|
497
|
+
# @param create_public_key_request [CreatePublicKeyRequest] Public key details
|
|
498
|
+
# @param [Hash] opts the optional parameters
|
|
499
|
+
# @return [Array<(CreatePublicKey200Response, Integer, Hash)>] CreatePublicKey200Response data, response status code and response headers
|
|
500
|
+
def create_public_key_with_http_info(create_public_key_request, opts = {})
|
|
501
|
+
if @api_client.config.debugging
|
|
502
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.create_public_key ...'
|
|
503
|
+
end
|
|
504
|
+
# verify the required parameter 'create_public_key_request' is set
|
|
505
|
+
if @api_client.config.client_side_validation && create_public_key_request.nil?
|
|
506
|
+
fail ArgumentError, "Missing the required parameter 'create_public_key_request' when calling TremendousApi.create_public_key"
|
|
507
|
+
end
|
|
508
|
+
# resource path
|
|
509
|
+
local_var_path = '/public_keys'
|
|
510
|
+
|
|
511
|
+
# query parameters
|
|
512
|
+
query_params = opts[:query_params] || {}
|
|
513
|
+
|
|
514
|
+
# header parameters
|
|
515
|
+
header_params = opts[:header_params] || {}
|
|
516
|
+
# HTTP header 'Accept' (if needed)
|
|
517
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
518
|
+
# HTTP header 'Content-Type'
|
|
519
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
520
|
+
if !content_type.nil?
|
|
521
|
+
header_params['Content-Type'] = content_type
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
# form parameters
|
|
525
|
+
form_params = opts[:form_params] || {}
|
|
526
|
+
|
|
527
|
+
# http body (model)
|
|
528
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_public_key_request)
|
|
529
|
+
|
|
530
|
+
# return_type
|
|
531
|
+
return_type = opts[:debug_return_type] || 'CreatePublicKey200Response'
|
|
532
|
+
|
|
533
|
+
# auth_names
|
|
534
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
535
|
+
|
|
536
|
+
new_options = opts.merge(
|
|
537
|
+
:operation => :"TremendousApi.create_public_key",
|
|
538
|
+
:header_params => header_params,
|
|
539
|
+
:query_params => query_params,
|
|
540
|
+
:form_params => form_params,
|
|
541
|
+
:body => post_body,
|
|
542
|
+
:auth_names => auth_names,
|
|
543
|
+
:return_type => return_type
|
|
544
|
+
)
|
|
545
|
+
|
|
546
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
547
|
+
if @api_client.config.debugging
|
|
548
|
+
@api_client.config.logger.debug "API called: TremendousApi#create_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
549
|
+
end
|
|
550
|
+
return data, status_code, headers
|
|
551
|
+
end
|
|
552
|
+
|
|
419
553
|
# Create webhook
|
|
420
554
|
# Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## 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\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
|
|
421
555
|
# @param create_webhook_request [CreateWebhookRequest] Webhook details
|
|
@@ -486,7 +620,7 @@ module Tremendous
|
|
|
486
620
|
|
|
487
621
|
# Delete invoice
|
|
488
622
|
# Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
489
|
-
# @param id [String] ID of the invoice that should be
|
|
623
|
+
# @param id [String] ID of the invoice that should be removed
|
|
490
624
|
# @param [Hash] opts the optional parameters
|
|
491
625
|
# @return [CreateInvoice200Response]
|
|
492
626
|
def delete_invoices(id, opts = {})
|
|
@@ -496,7 +630,7 @@ module Tremendous
|
|
|
496
630
|
|
|
497
631
|
# Delete invoice
|
|
498
632
|
# Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
499
|
-
# @param id [String] ID of the invoice that should be
|
|
633
|
+
# @param id [String] ID of the invoice that should be removed
|
|
500
634
|
# @param [Hash] opts the optional parameters
|
|
501
635
|
# @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
|
|
502
636
|
def delete_invoices_with_http_info(id, opts = {})
|
|
@@ -547,6 +681,142 @@ module Tremendous
|
|
|
547
681
|
return data, status_code, headers
|
|
548
682
|
end
|
|
549
683
|
|
|
684
|
+
# Delete public key
|
|
685
|
+
# Deactivates a public key. Any further attempt to verify a request signature with this key will fail.
|
|
686
|
+
# @param id [String] ID of the public key that should be deactivated
|
|
687
|
+
# @param [Hash] opts the optional parameters
|
|
688
|
+
# @return [nil]
|
|
689
|
+
def delete_public_key(id, opts = {})
|
|
690
|
+
delete_public_key_with_http_info(id, opts)
|
|
691
|
+
nil
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
# Delete public key
|
|
695
|
+
# Deactivates a public key. Any further attempt to verify a request signature with this key will fail.
|
|
696
|
+
# @param id [String] ID of the public key that should be deactivated
|
|
697
|
+
# @param [Hash] opts the optional parameters
|
|
698
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
699
|
+
def delete_public_key_with_http_info(id, opts = {})
|
|
700
|
+
if @api_client.config.debugging
|
|
701
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.delete_public_key ...'
|
|
702
|
+
end
|
|
703
|
+
# verify the required parameter 'id' is set
|
|
704
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
705
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_public_key"
|
|
706
|
+
end
|
|
707
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
708
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
709
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_public_key, must conform to the pattern #{pattern}."
|
|
710
|
+
end
|
|
711
|
+
|
|
712
|
+
# resource path
|
|
713
|
+
local_var_path = '/public_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
714
|
+
|
|
715
|
+
# query parameters
|
|
716
|
+
query_params = opts[:query_params] || {}
|
|
717
|
+
|
|
718
|
+
# header parameters
|
|
719
|
+
header_params = opts[:header_params] || {}
|
|
720
|
+
# HTTP header 'Accept' (if needed)
|
|
721
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
722
|
+
|
|
723
|
+
# form parameters
|
|
724
|
+
form_params = opts[:form_params] || {}
|
|
725
|
+
|
|
726
|
+
# http body (model)
|
|
727
|
+
post_body = opts[:debug_body]
|
|
728
|
+
|
|
729
|
+
# return_type
|
|
730
|
+
return_type = opts[:debug_return_type]
|
|
731
|
+
|
|
732
|
+
# auth_names
|
|
733
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
734
|
+
|
|
735
|
+
new_options = opts.merge(
|
|
736
|
+
:operation => :"TremendousApi.delete_public_key",
|
|
737
|
+
:header_params => header_params,
|
|
738
|
+
:query_params => query_params,
|
|
739
|
+
:form_params => form_params,
|
|
740
|
+
:body => post_body,
|
|
741
|
+
:auth_names => auth_names,
|
|
742
|
+
:return_type => return_type
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
746
|
+
if @api_client.config.debugging
|
|
747
|
+
@api_client.config.logger.debug "API called: TremendousApi#delete_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
748
|
+
end
|
|
749
|
+
return data, status_code, headers
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
# Delete webhook
|
|
753
|
+
# > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
754
|
+
# @param id [String] ID of the webhook to delete
|
|
755
|
+
# @param [Hash] opts the optional parameters
|
|
756
|
+
# @return [nil]
|
|
757
|
+
def delete_webhook(id, opts = {})
|
|
758
|
+
delete_webhook_with_http_info(id, opts)
|
|
759
|
+
nil
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
# Delete webhook
|
|
763
|
+
# > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
764
|
+
# @param id [String] ID of the webhook to delete
|
|
765
|
+
# @param [Hash] opts the optional parameters
|
|
766
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
767
|
+
def delete_webhook_with_http_info(id, opts = {})
|
|
768
|
+
if @api_client.config.debugging
|
|
769
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.delete_webhook ...'
|
|
770
|
+
end
|
|
771
|
+
# verify the required parameter 'id' is set
|
|
772
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
773
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_webhook"
|
|
774
|
+
end
|
|
775
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
776
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
777
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_webhook, must conform to the pattern #{pattern}."
|
|
778
|
+
end
|
|
779
|
+
|
|
780
|
+
# resource path
|
|
781
|
+
local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
782
|
+
|
|
783
|
+
# query parameters
|
|
784
|
+
query_params = opts[:query_params] || {}
|
|
785
|
+
|
|
786
|
+
# header parameters
|
|
787
|
+
header_params = opts[:header_params] || {}
|
|
788
|
+
# HTTP header 'Accept' (if needed)
|
|
789
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
790
|
+
|
|
791
|
+
# form parameters
|
|
792
|
+
form_params = opts[:form_params] || {}
|
|
793
|
+
|
|
794
|
+
# http body (model)
|
|
795
|
+
post_body = opts[:debug_body]
|
|
796
|
+
|
|
797
|
+
# return_type
|
|
798
|
+
return_type = opts[:debug_return_type]
|
|
799
|
+
|
|
800
|
+
# auth_names
|
|
801
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
802
|
+
|
|
803
|
+
new_options = opts.merge(
|
|
804
|
+
:operation => :"TremendousApi.delete_webhook",
|
|
805
|
+
:header_params => header_params,
|
|
806
|
+
:query_params => query_params,
|
|
807
|
+
:form_params => form_params,
|
|
808
|
+
:body => post_body,
|
|
809
|
+
:auth_names => auth_names,
|
|
810
|
+
:return_type => return_type
|
|
811
|
+
)
|
|
812
|
+
|
|
813
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
814
|
+
if @api_client.config.debugging
|
|
815
|
+
@api_client.config.logger.debug "API called: TremendousApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
816
|
+
end
|
|
817
|
+
return data, status_code, headers
|
|
818
|
+
end
|
|
819
|
+
|
|
550
820
|
# Retrieve invoice as CSV
|
|
551
821
|
# Generates a CSV version for an invoice listing the associated rewards and orders
|
|
552
822
|
# @param id [String] ID of the Invoice for that the CSV should be generated
|
|
@@ -813,7 +1083,7 @@ module Tremendous
|
|
|
813
1083
|
# Retrieve a campaign, identified by the given `id` in the URL
|
|
814
1084
|
# @param id [String] ID of the campaign that should be retrieved
|
|
815
1085
|
# @param [Hash] opts the optional parameters
|
|
816
|
-
# @return [
|
|
1086
|
+
# @return [CreateCampaign201Response]
|
|
817
1087
|
def get_campaign(id, opts = {})
|
|
818
1088
|
data, _status_code, _headers = get_campaign_with_http_info(id, opts)
|
|
819
1089
|
data
|
|
@@ -823,7 +1093,7 @@ module Tremendous
|
|
|
823
1093
|
# Retrieve a campaign, identified by the given `id` in the URL
|
|
824
1094
|
# @param id [String] ID of the campaign that should be retrieved
|
|
825
1095
|
# @param [Hash] opts the optional parameters
|
|
826
|
-
# @return [Array<(
|
|
1096
|
+
# @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
|
|
827
1097
|
def get_campaign_with_http_info(id, opts = {})
|
|
828
1098
|
if @api_client.config.debugging
|
|
829
1099
|
@api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...'
|
|
@@ -855,7 +1125,7 @@ module Tremendous
|
|
|
855
1125
|
post_body = opts[:debug_body]
|
|
856
1126
|
|
|
857
1127
|
# return_type
|
|
858
|
-
return_type = opts[:debug_return_type] || '
|
|
1128
|
+
return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
|
|
859
1129
|
|
|
860
1130
|
# auth_names
|
|
861
1131
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
@@ -1271,6 +1541,74 @@ module Tremendous
|
|
|
1271
1541
|
return data, status_code, headers
|
|
1272
1542
|
end
|
|
1273
1543
|
|
|
1544
|
+
# Retrieve public key
|
|
1545
|
+
# Retrieve an active public key, identified by the given `id` in the URL.
|
|
1546
|
+
# @param id [String] ID of the public key that should be retrieved
|
|
1547
|
+
# @param [Hash] opts the optional parameters
|
|
1548
|
+
# @return [CreatePublicKey200Response]
|
|
1549
|
+
def get_public_key(id, opts = {})
|
|
1550
|
+
data, _status_code, _headers = get_public_key_with_http_info(id, opts)
|
|
1551
|
+
data
|
|
1552
|
+
end
|
|
1553
|
+
|
|
1554
|
+
# Retrieve public key
|
|
1555
|
+
# Retrieve an active public key, identified by the given `id` in the URL.
|
|
1556
|
+
# @param id [String] ID of the public key that should be retrieved
|
|
1557
|
+
# @param [Hash] opts the optional parameters
|
|
1558
|
+
# @return [Array<(CreatePublicKey200Response, Integer, Hash)>] CreatePublicKey200Response data, response status code and response headers
|
|
1559
|
+
def get_public_key_with_http_info(id, opts = {})
|
|
1560
|
+
if @api_client.config.debugging
|
|
1561
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.get_public_key ...'
|
|
1562
|
+
end
|
|
1563
|
+
# verify the required parameter 'id' is set
|
|
1564
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1565
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_public_key"
|
|
1566
|
+
end
|
|
1567
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
1568
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
1569
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_public_key, must conform to the pattern #{pattern}."
|
|
1570
|
+
end
|
|
1571
|
+
|
|
1572
|
+
# resource path
|
|
1573
|
+
local_var_path = '/public_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1574
|
+
|
|
1575
|
+
# query parameters
|
|
1576
|
+
query_params = opts[:query_params] || {}
|
|
1577
|
+
|
|
1578
|
+
# header parameters
|
|
1579
|
+
header_params = opts[:header_params] || {}
|
|
1580
|
+
# HTTP header 'Accept' (if needed)
|
|
1581
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1582
|
+
|
|
1583
|
+
# form parameters
|
|
1584
|
+
form_params = opts[:form_params] || {}
|
|
1585
|
+
|
|
1586
|
+
# http body (model)
|
|
1587
|
+
post_body = opts[:debug_body]
|
|
1588
|
+
|
|
1589
|
+
# return_type
|
|
1590
|
+
return_type = opts[:debug_return_type] || 'CreatePublicKey200Response'
|
|
1591
|
+
|
|
1592
|
+
# auth_names
|
|
1593
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
1594
|
+
|
|
1595
|
+
new_options = opts.merge(
|
|
1596
|
+
:operation => :"TremendousApi.get_public_key",
|
|
1597
|
+
:header_params => header_params,
|
|
1598
|
+
:query_params => query_params,
|
|
1599
|
+
:form_params => form_params,
|
|
1600
|
+
:body => post_body,
|
|
1601
|
+
:auth_names => auth_names,
|
|
1602
|
+
:return_type => return_type
|
|
1603
|
+
)
|
|
1604
|
+
|
|
1605
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1606
|
+
if @api_client.config.debugging
|
|
1607
|
+
@api_client.config.logger.debug "API called: TremendousApi#get_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1608
|
+
end
|
|
1609
|
+
return data, status_code, headers
|
|
1610
|
+
end
|
|
1611
|
+
|
|
1274
1612
|
# Retrieve single reward
|
|
1275
1613
|
# Retrieve the reward, identified by the given `id` in the URL
|
|
1276
1614
|
# @param id [String] ID of the reward that should be retrieved
|
|
@@ -1590,6 +1928,66 @@ module Tremendous
|
|
|
1590
1928
|
return data, status_code, headers
|
|
1591
1929
|
end
|
|
1592
1930
|
|
|
1931
|
+
# List exchange rates
|
|
1932
|
+
# Retrieve a list of exchange rates
|
|
1933
|
+
# @param [Hash] opts the optional parameters
|
|
1934
|
+
# @option opts [String] :base Base currency code, default is USD.
|
|
1935
|
+
# @return [ListForexResponse]
|
|
1936
|
+
def list_forex(opts = {})
|
|
1937
|
+
data, _status_code, _headers = list_forex_with_http_info(opts)
|
|
1938
|
+
data
|
|
1939
|
+
end
|
|
1940
|
+
|
|
1941
|
+
# List exchange rates
|
|
1942
|
+
# Retrieve a list of exchange rates
|
|
1943
|
+
# @param [Hash] opts the optional parameters
|
|
1944
|
+
# @option opts [String] :base Base currency code, default is USD.
|
|
1945
|
+
# @return [Array<(ListForexResponse, Integer, Hash)>] ListForexResponse data, response status code and response headers
|
|
1946
|
+
def list_forex_with_http_info(opts = {})
|
|
1947
|
+
if @api_client.config.debugging
|
|
1948
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_forex ...'
|
|
1949
|
+
end
|
|
1950
|
+
# resource path
|
|
1951
|
+
local_var_path = '/forex'
|
|
1952
|
+
|
|
1953
|
+
# query parameters
|
|
1954
|
+
query_params = opts[:query_params] || {}
|
|
1955
|
+
query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?
|
|
1956
|
+
|
|
1957
|
+
# header parameters
|
|
1958
|
+
header_params = opts[:header_params] || {}
|
|
1959
|
+
# HTTP header 'Accept' (if needed)
|
|
1960
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1961
|
+
|
|
1962
|
+
# form parameters
|
|
1963
|
+
form_params = opts[:form_params] || {}
|
|
1964
|
+
|
|
1965
|
+
# http body (model)
|
|
1966
|
+
post_body = opts[:debug_body]
|
|
1967
|
+
|
|
1968
|
+
# return_type
|
|
1969
|
+
return_type = opts[:debug_return_type] || 'ListForexResponse'
|
|
1970
|
+
|
|
1971
|
+
# auth_names
|
|
1972
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
1973
|
+
|
|
1974
|
+
new_options = opts.merge(
|
|
1975
|
+
:operation => :"TremendousApi.list_forex",
|
|
1976
|
+
:header_params => header_params,
|
|
1977
|
+
:query_params => query_params,
|
|
1978
|
+
:form_params => form_params,
|
|
1979
|
+
:body => post_body,
|
|
1980
|
+
:auth_names => auth_names,
|
|
1981
|
+
:return_type => return_type
|
|
1982
|
+
)
|
|
1983
|
+
|
|
1984
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1985
|
+
if @api_client.config.debugging
|
|
1986
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_forex\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1987
|
+
end
|
|
1988
|
+
return data, status_code, headers
|
|
1989
|
+
end
|
|
1990
|
+
|
|
1593
1991
|
# List funding sources
|
|
1594
1992
|
# Retrieve a list of all funding sources available for ordering through the API in your organization's account.
|
|
1595
1993
|
# @param [Hash] opts the optional parameters
|
|
@@ -1962,6 +2360,63 @@ module Tremendous
|
|
|
1962
2360
|
return data, status_code, headers
|
|
1963
2361
|
end
|
|
1964
2362
|
|
|
2363
|
+
# List public keys
|
|
2364
|
+
# Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys.
|
|
2365
|
+
# @param [Hash] opts the optional parameters
|
|
2366
|
+
# @return [PublicKeysResponse]
|
|
2367
|
+
def list_public_keys(opts = {})
|
|
2368
|
+
data, _status_code, _headers = list_public_keys_with_http_info(opts)
|
|
2369
|
+
data
|
|
2370
|
+
end
|
|
2371
|
+
|
|
2372
|
+
# List public keys
|
|
2373
|
+
# Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys.
|
|
2374
|
+
# @param [Hash] opts the optional parameters
|
|
2375
|
+
# @return [Array<(PublicKeysResponse, Integer, Hash)>] PublicKeysResponse data, response status code and response headers
|
|
2376
|
+
def list_public_keys_with_http_info(opts = {})
|
|
2377
|
+
if @api_client.config.debugging
|
|
2378
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_public_keys ...'
|
|
2379
|
+
end
|
|
2380
|
+
# resource path
|
|
2381
|
+
local_var_path = '/public_keys'
|
|
2382
|
+
|
|
2383
|
+
# query parameters
|
|
2384
|
+
query_params = opts[:query_params] || {}
|
|
2385
|
+
|
|
2386
|
+
# header parameters
|
|
2387
|
+
header_params = opts[:header_params] || {}
|
|
2388
|
+
# HTTP header 'Accept' (if needed)
|
|
2389
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2390
|
+
|
|
2391
|
+
# form parameters
|
|
2392
|
+
form_params = opts[:form_params] || {}
|
|
2393
|
+
|
|
2394
|
+
# http body (model)
|
|
2395
|
+
post_body = opts[:debug_body]
|
|
2396
|
+
|
|
2397
|
+
# return_type
|
|
2398
|
+
return_type = opts[:debug_return_type] || 'PublicKeysResponse'
|
|
2399
|
+
|
|
2400
|
+
# auth_names
|
|
2401
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
2402
|
+
|
|
2403
|
+
new_options = opts.merge(
|
|
2404
|
+
:operation => :"TremendousApi.list_public_keys",
|
|
2405
|
+
:header_params => header_params,
|
|
2406
|
+
:query_params => query_params,
|
|
2407
|
+
:form_params => form_params,
|
|
2408
|
+
:body => post_body,
|
|
2409
|
+
:auth_names => auth_names,
|
|
2410
|
+
:return_type => return_type
|
|
2411
|
+
)
|
|
2412
|
+
|
|
2413
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2414
|
+
if @api_client.config.debugging
|
|
2415
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_public_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2416
|
+
end
|
|
2417
|
+
return data, status_code, headers
|
|
2418
|
+
end
|
|
2419
|
+
|
|
1965
2420
|
# List rewards
|
|
1966
2421
|
# Retrieve a list of all created rewards
|
|
1967
2422
|
# @param [Hash] opts the optional parameters
|
|
@@ -2022,6 +2477,63 @@ module Tremendous
|
|
|
2022
2477
|
return data, status_code, headers
|
|
2023
2478
|
end
|
|
2024
2479
|
|
|
2480
|
+
# List roles
|
|
2481
|
+
# List all available roles in the organization.
|
|
2482
|
+
# @param [Hash] opts the optional parameters
|
|
2483
|
+
# @return [ListRoles200Response]
|
|
2484
|
+
def list_roles(opts = {})
|
|
2485
|
+
data, _status_code, _headers = list_roles_with_http_info(opts)
|
|
2486
|
+
data
|
|
2487
|
+
end
|
|
2488
|
+
|
|
2489
|
+
# List roles
|
|
2490
|
+
# List all available roles in the organization.
|
|
2491
|
+
# @param [Hash] opts the optional parameters
|
|
2492
|
+
# @return [Array<(ListRoles200Response, Integer, Hash)>] ListRoles200Response data, response status code and response headers
|
|
2493
|
+
def list_roles_with_http_info(opts = {})
|
|
2494
|
+
if @api_client.config.debugging
|
|
2495
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_roles ...'
|
|
2496
|
+
end
|
|
2497
|
+
# resource path
|
|
2498
|
+
local_var_path = '/roles'
|
|
2499
|
+
|
|
2500
|
+
# query parameters
|
|
2501
|
+
query_params = opts[:query_params] || {}
|
|
2502
|
+
|
|
2503
|
+
# header parameters
|
|
2504
|
+
header_params = opts[:header_params] || {}
|
|
2505
|
+
# HTTP header 'Accept' (if needed)
|
|
2506
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2507
|
+
|
|
2508
|
+
# form parameters
|
|
2509
|
+
form_params = opts[:form_params] || {}
|
|
2510
|
+
|
|
2511
|
+
# http body (model)
|
|
2512
|
+
post_body = opts[:debug_body]
|
|
2513
|
+
|
|
2514
|
+
# return_type
|
|
2515
|
+
return_type = opts[:debug_return_type] || 'ListRoles200Response'
|
|
2516
|
+
|
|
2517
|
+
# auth_names
|
|
2518
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
2519
|
+
|
|
2520
|
+
new_options = opts.merge(
|
|
2521
|
+
:operation => :"TremendousApi.list_roles",
|
|
2522
|
+
:header_params => header_params,
|
|
2523
|
+
:query_params => query_params,
|
|
2524
|
+
:form_params => form_params,
|
|
2525
|
+
:body => post_body,
|
|
2526
|
+
:auth_names => auth_names,
|
|
2527
|
+
:return_type => return_type
|
|
2528
|
+
)
|
|
2529
|
+
|
|
2530
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2531
|
+
if @api_client.config.debugging
|
|
2532
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2533
|
+
end
|
|
2534
|
+
return data, status_code, headers
|
|
2535
|
+
end
|
|
2536
|
+
|
|
2025
2537
|
# List events
|
|
2026
2538
|
# Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
|
|
2027
2539
|
# @param id [String] ID of the webhook to list the events for
|
|
@@ -2361,5 +2873,161 @@ module Tremendous
|
|
|
2361
2873
|
end
|
|
2362
2874
|
return data, status_code, headers
|
|
2363
2875
|
end
|
|
2876
|
+
|
|
2877
|
+
# Test public key
|
|
2878
|
+
# Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.
|
|
2879
|
+
# @param id [String] ID of the public key to test
|
|
2880
|
+
# @param test_public_key_request [TestPublicKeyRequest]
|
|
2881
|
+
# @param [Hash] opts the optional parameters
|
|
2882
|
+
# @return [nil]
|
|
2883
|
+
def test_public_key(id, test_public_key_request, opts = {})
|
|
2884
|
+
test_public_key_with_http_info(id, test_public_key_request, opts)
|
|
2885
|
+
nil
|
|
2886
|
+
end
|
|
2887
|
+
|
|
2888
|
+
# Test public key
|
|
2889
|
+
# Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.
|
|
2890
|
+
# @param id [String] ID of the public key to test
|
|
2891
|
+
# @param test_public_key_request [TestPublicKeyRequest]
|
|
2892
|
+
# @param [Hash] opts the optional parameters
|
|
2893
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
2894
|
+
def test_public_key_with_http_info(id, test_public_key_request, opts = {})
|
|
2895
|
+
if @api_client.config.debugging
|
|
2896
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.test_public_key ...'
|
|
2897
|
+
end
|
|
2898
|
+
# verify the required parameter 'id' is set
|
|
2899
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2900
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.test_public_key"
|
|
2901
|
+
end
|
|
2902
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
2903
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
2904
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.test_public_key, must conform to the pattern #{pattern}."
|
|
2905
|
+
end
|
|
2906
|
+
|
|
2907
|
+
# verify the required parameter 'test_public_key_request' is set
|
|
2908
|
+
if @api_client.config.client_side_validation && test_public_key_request.nil?
|
|
2909
|
+
fail ArgumentError, "Missing the required parameter 'test_public_key_request' when calling TremendousApi.test_public_key"
|
|
2910
|
+
end
|
|
2911
|
+
# resource path
|
|
2912
|
+
local_var_path = '/public_keys/{id}/decode_jwt'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2913
|
+
|
|
2914
|
+
# query parameters
|
|
2915
|
+
query_params = opts[:query_params] || {}
|
|
2916
|
+
|
|
2917
|
+
# header parameters
|
|
2918
|
+
header_params = opts[:header_params] || {}
|
|
2919
|
+
# HTTP header 'Accept' (if needed)
|
|
2920
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2921
|
+
# HTTP header 'Content-Type'
|
|
2922
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
2923
|
+
if !content_type.nil?
|
|
2924
|
+
header_params['Content-Type'] = content_type
|
|
2925
|
+
end
|
|
2926
|
+
|
|
2927
|
+
# form parameters
|
|
2928
|
+
form_params = opts[:form_params] || {}
|
|
2929
|
+
|
|
2930
|
+
# http body (model)
|
|
2931
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(test_public_key_request)
|
|
2932
|
+
|
|
2933
|
+
# return_type
|
|
2934
|
+
return_type = opts[:debug_return_type]
|
|
2935
|
+
|
|
2936
|
+
# auth_names
|
|
2937
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
2938
|
+
|
|
2939
|
+
new_options = opts.merge(
|
|
2940
|
+
:operation => :"TremendousApi.test_public_key",
|
|
2941
|
+
:header_params => header_params,
|
|
2942
|
+
:query_params => query_params,
|
|
2943
|
+
:form_params => form_params,
|
|
2944
|
+
:body => post_body,
|
|
2945
|
+
:auth_names => auth_names,
|
|
2946
|
+
:return_type => return_type
|
|
2947
|
+
)
|
|
2948
|
+
|
|
2949
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2950
|
+
if @api_client.config.debugging
|
|
2951
|
+
@api_client.config.logger.debug "API called: TremendousApi#test_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2952
|
+
end
|
|
2953
|
+
return data, status_code, headers
|
|
2954
|
+
end
|
|
2955
|
+
|
|
2956
|
+
# Update campaign
|
|
2957
|
+
# @param id [String] ID of the campaign that should be updated
|
|
2958
|
+
# @param update_campaign_request [UpdateCampaignRequest] Campaign details
|
|
2959
|
+
# @param [Hash] opts the optional parameters
|
|
2960
|
+
# @return [CreateCampaign201Response]
|
|
2961
|
+
def update_campaign(id, update_campaign_request, opts = {})
|
|
2962
|
+
data, _status_code, _headers = update_campaign_with_http_info(id, update_campaign_request, opts)
|
|
2963
|
+
data
|
|
2964
|
+
end
|
|
2965
|
+
|
|
2966
|
+
# Update campaign
|
|
2967
|
+
# @param id [String] ID of the campaign that should be updated
|
|
2968
|
+
# @param update_campaign_request [UpdateCampaignRequest] Campaign details
|
|
2969
|
+
# @param [Hash] opts the optional parameters
|
|
2970
|
+
# @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
|
|
2971
|
+
def update_campaign_with_http_info(id, update_campaign_request, opts = {})
|
|
2972
|
+
if @api_client.config.debugging
|
|
2973
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
|
|
2974
|
+
end
|
|
2975
|
+
# verify the required parameter 'id' is set
|
|
2976
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2977
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_campaign"
|
|
2978
|
+
end
|
|
2979
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
2980
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
2981
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}."
|
|
2982
|
+
end
|
|
2983
|
+
|
|
2984
|
+
# verify the required parameter 'update_campaign_request' is set
|
|
2985
|
+
if @api_client.config.client_side_validation && update_campaign_request.nil?
|
|
2986
|
+
fail ArgumentError, "Missing the required parameter 'update_campaign_request' when calling TremendousApi.update_campaign"
|
|
2987
|
+
end
|
|
2988
|
+
# resource path
|
|
2989
|
+
local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2990
|
+
|
|
2991
|
+
# query parameters
|
|
2992
|
+
query_params = opts[:query_params] || {}
|
|
2993
|
+
|
|
2994
|
+
# header parameters
|
|
2995
|
+
header_params = opts[:header_params] || {}
|
|
2996
|
+
# HTTP header 'Accept' (if needed)
|
|
2997
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2998
|
+
# HTTP header 'Content-Type'
|
|
2999
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
3000
|
+
if !content_type.nil?
|
|
3001
|
+
header_params['Content-Type'] = content_type
|
|
3002
|
+
end
|
|
3003
|
+
|
|
3004
|
+
# form parameters
|
|
3005
|
+
form_params = opts[:form_params] || {}
|
|
3006
|
+
|
|
3007
|
+
# http body (model)
|
|
3008
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_request)
|
|
3009
|
+
|
|
3010
|
+
# return_type
|
|
3011
|
+
return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
|
|
3012
|
+
|
|
3013
|
+
# auth_names
|
|
3014
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
3015
|
+
|
|
3016
|
+
new_options = opts.merge(
|
|
3017
|
+
:operation => :"TremendousApi.update_campaign",
|
|
3018
|
+
:header_params => header_params,
|
|
3019
|
+
:query_params => query_params,
|
|
3020
|
+
:form_params => form_params,
|
|
3021
|
+
:body => post_body,
|
|
3022
|
+
:auth_names => auth_names,
|
|
3023
|
+
:return_type => return_type
|
|
3024
|
+
)
|
|
3025
|
+
|
|
3026
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
3027
|
+
if @api_client.config.debugging
|
|
3028
|
+
@api_client.config.logger.debug "API called: TremendousApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
3029
|
+
end
|
|
3030
|
+
return data, status_code, headers
|
|
3031
|
+
end
|
|
2364
3032
|
end
|
|
2365
3033
|
end
|