Class: Tremendous::TremendousApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tremendous/api/tremendous_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TremendousApi

Returns a new instance of TremendousApi.



19
20
21
# File 'lib/tremendous/api/tremendous_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/tremendous/api/tremendous_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#approve_order(id, opts = {}) ⇒ GetOrder200Response

Approve order Approves an order that is pending review, identified by the given ‘id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable ’Allow approvals via API’ via the organization”s ‘Order Approvals’ settings from the Tremendous dashboard.

Parameters:

  • id (String)

    ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/tremendous/api/tremendous_api.rb', line 27

def approve_order(id, opts = {})
  data, _status_code, _headers = approve_order_with_http_info(id, opts)
  data
end

#approve_order_with_http_info(id, opts = {}) ⇒ Array<(GetOrder200Response, Integer, Hash)>

Approve order Approves an order that is pending review, identified by the given &#x60;id&#x60; in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable &#39;Allow approvals via API&#39; via the organization&#39;&#39;s &#39;Order Approvals&#39; settings from the Tremendous dashboard.

Parameters:

  • id (String)

    ID of the order that should be approved. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrder200Response, Integer, Hash)>)

    GetOrder200Response data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/tremendous/api/tremendous_api.rb', line 37

def approve_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.approve_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.approve_order"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.approve_order, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/order_approvals/{id}/approve'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.approve_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#approve_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#block_fraud_review(id, opts = {}) ⇒ GetFraudReview200Response

Block fraud review Completes the fraud review identified by the given ‘id` in the URL, and blocks the reward. The reward is canceled and the amount refunded.

Parameters:

  • id (String)

    The ID of the reward that should be blocked.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



95
96
97
98
# File 'lib/tremendous/api/tremendous_api.rb', line 95

def block_fraud_review(id, opts = {})
  data, _status_code, _headers = block_fraud_review_with_http_info(id, opts)
  data
end

#block_fraud_review_with_http_info(id, opts = {}) ⇒ Array<(GetFraudReview200Response, Integer, Hash)>

Block fraud review Completes the fraud review identified by the given &#x60;id&#x60; in the URL, and blocks the reward. The reward is canceled and the amount refunded.

Parameters:

  • id (String)

    The ID of the reward that should be blocked.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFraudReview200Response, Integer, Hash)>)

    GetFraudReview200Response data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/tremendous/api/tremendous_api.rb', line 105

def block_fraud_review_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.block_fraud_review ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.block_fraud_review"
  end
  # resource path
  local_var_path = '/fraud_reviews/{id}/block'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFraudReview200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.block_fraud_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#block_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_api_key(opts = {}) ⇒ CreateApiKey200Response

Create API key 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.**

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



157
158
159
160
# File 'lib/tremendous/api/tremendous_api.rb', line 157

def create_api_key(opts = {})
  data, _status_code, _headers = create_api_key_with_http_info(opts)
  data
end

#create_api_key_with_http_info(opts = {}) ⇒ Array<(CreateApiKey200Response, Integer, Hash)>

Create API key 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.**

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateApiKey200Response, Integer, Hash)>)

    CreateApiKey200Response data, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/tremendous/api/tremendous_api.rb', line 166

def create_api_key_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_api_key ...'
  end
  # resource path
  local_var_path = '/organizations/create_api_key'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateApiKey200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_campaign(create_campaign_request, opts = {}) ⇒ CreateCampaign201Response

Create campaign

Parameters:

  • create_campaign_request (CreateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



214
215
216
217
# File 'lib/tremendous/api/tremendous_api.rb', line 214

def create_campaign(create_campaign_request, opts = {})
  data, _status_code, _headers = create_campaign_with_http_info(create_campaign_request, opts)
  data
end

#create_campaign_with_http_info(create_campaign_request, opts = {}) ⇒ Array<(CreateCampaign201Response, Integer, Hash)>

Create campaign

Parameters:

  • create_campaign_request (CreateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateCampaign201Response, Integer, Hash)>)

    CreateCampaign201Response data, response status code and response headers



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/tremendous/api/tremendous_api.rb', line 223

def create_campaign_with_http_info(create_campaign_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_campaign ...'
  end
  # verify the required parameter 'create_campaign_request' is set
  if @api_client.config.client_side_validation && create_campaign_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.create_campaign"
  end
  # resource path
  local_var_path = '/campaigns'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCampaign201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_campaign",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_invoice(create_invoice_request, opts = {}) ⇒ CreateInvoice200Response

Create invoice 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>

Parameters:

  • create_invoice_request (CreateInvoiceRequest)

    Invoice details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



281
282
283
284
# File 'lib/tremendous/api/tremendous_api.rb', line 281

def create_invoice(create_invoice_request, opts = {})
  data, _status_code, _headers = create_invoice_with_http_info(create_invoice_request, opts)
  data
end

#create_invoice_with_http_info(create_invoice_request, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>

Create invoice Creating an invoice is the way for your organization to fund your account&#39;s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account&#39;s balance ## Request body &lt;div class&#x3D;&quot;object-schema-request-schema&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;po_number&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Reference to the purchase order number within your organization&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;amount&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the invoice in USD&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;memo&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;

Parameters:

  • create_invoice_request (CreateInvoiceRequest)

    Invoice details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateInvoice200Response, Integer, Hash)>)

    CreateInvoice200Response data, response status code and response headers



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/tremendous/api/tremendous_api.rb', line 291

def create_invoice_with_http_info(create_invoice_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_invoice ...'
  end
  # verify the required parameter 'create_invoice_request' is set
  if @api_client.config.client_side_validation && create_invoice_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_invoice_request' when calling TremendousApi.create_invoice"
  end
  # resource path
  local_var_path = '/invoices'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_invoice_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateInvoice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_invoice",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_member(create_member_request, opts = {}) ⇒ CreateMember200Response

Create member 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.

Parameters:

  • create_member_request (CreateMemberRequest)

    Member details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



349
350
351
352
# File 'lib/tremendous/api/tremendous_api.rb', line 349

def create_member(create_member_request, opts = {})
  data, _status_code, _headers = create_member_with_http_info(create_member_request, opts)
  data
end

#create_member_with_http_info(create_member_request, opts = {}) ⇒ Array<(CreateMember200Response, Integer, Hash)>

Create member 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. &gt; ❗️ Automatic invitations are not available in the sandbox &gt; &gt; You must manually use the returned &#x60;invite_url&#x60; field in the payload instead.

Parameters:

  • create_member_request (CreateMemberRequest)

    Member details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateMember200Response, Integer, Hash)>)

    CreateMember200Response data, response status code and response headers



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/tremendous/api/tremendous_api.rb', line 359

def create_member_with_http_info(create_member_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_member ...'
  end
  # verify the required parameter 'create_member_request' is set
  if @api_client.config.client_side_validation && create_member_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_member_request' when calling TremendousApi.create_member"
  end
  # resource path
  local_var_path = '/members'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_member_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_order(create_order_request, opts = {}) ⇒ CreateOrder200Response

Create order 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, external_id makes order idempotent. All requests that use the same external_id after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a 201 response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by external_id instead of id 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 balance 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 products or campaign_id 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 products array will override the products made available by the campaign specified using the campaign_id property unless the products array is empty. It will not 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="en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO-639-1 code</a> for the desired language. Defaults to en.</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>EMAIL</td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td>LINK</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 /rewards or /rewards/{id} endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td>PHONE</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](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](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.

Parameters:

  • create_order_request (CreateOrderRequest)

    Order to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



417
418
419
420
# File 'lib/tremendous/api/tremendous_api.rb', line 417

def create_order(create_order_request, opts = {})
  data, _status_code, _headers = create_order_with_http_info(create_order_request, opts)
  data
end

#create_order_with_http_info(create_order_request, opts = {}) ⇒ Array<(CreateOrder200Response, Integer, Hash)>

Create order Every time you want to send out a reward through Tremendous you need to create an order for it. &gt; 📘 Getting started with your first order &gt; &gt; Our step-by-step guide walks you through everything you need &gt; to send your first gift card through the Tremendous API: &gt; &gt; &lt;strong&gt;&lt;a style&#x3D;&quot;display: block; margin-top: 20px;&quot; href&#x3D;&quot;/docs/sending-rewards-intro&quot;&gt;Check it out!&lt;/a&gt;&lt;/strong&gt; ## Request body &lt;div class&#x3D;&quot;object-schema-request-schema&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;external_id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Reference for this order, supplied by the customer.&lt;/p&gt; &lt;p&gt;When set, &lt;code&gt;external_id&lt;/code&gt; makes order idempotent. All requests that use the same &lt;code&gt;external_id&lt;/code&gt; after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a &lt;code&gt;201&lt;/code&gt; response code. These responses &lt;strong&gt;fail&lt;/strong&gt; to create any further orders.&lt;/p&gt; &lt;p&gt;It also allows for retrieving by &lt;code&gt;external_id&lt;/code&gt; instead of &lt;code&gt;id&lt;/code&gt; only.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;payment&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;funding_source_id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Tremendous ID of the funding source that will be used to pay for the order. Use &lt;code&gt;balance&lt;/code&gt; to use your Tremendous&amp;#39;s balance.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;reward&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;A single reward, sent to a recipient. A reward is always part of an order.&lt;/p&gt; &lt;p&gt;Either &lt;code&gt;products&lt;/code&gt; or &lt;code&gt;campaign_id&lt;/code&gt; must be specified.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;property-conditional-hint-response-only&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Tremendous ID of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;property-conditional-hint-response-only&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;order_id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Tremendous ID of the order this reward is part of.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;property-conditional-hint-response-only&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;created_at&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;date-time&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Date the reward was created&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;property-conditional-hint-request-only&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;campaign_id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;property-conditional-hint-request-only&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;products&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;array&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.&lt;/p&gt; &lt;p&gt;Providing a &lt;code&gt;products&lt;/code&gt; array will override the products made available by the campaign specified using the &lt;code&gt;campaign_id&lt;/code&gt; property unless the &lt;code&gt;products&lt;/code&gt; array is empty. It will &lt;em&gt;not&lt;/em&gt; override other campaign attributes, like the message and customization of the look and feel.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;value&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;denomination&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;currency_code&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Currency of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;recipient&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Details of the recipient of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;name&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Name of the recipient&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;email&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Email address of the recipient&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;phone&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;deliver_at&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;date&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;custom_fields&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;array&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show array item type&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Tremendous ID of the custom field&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;value&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Value of the custom field&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;property-conditional-hint-response-only&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;label&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Label of the custom field&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;language&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Set this to translate the redemption experience for this reward. Pass a 2-letter &lt;a href&#x3D;&quot;en.wikipedia.org/wiki/List_of_ISO_639-1_codes&quot;&gt;ISO-639-1 code&lt;/a&gt; for the desired language. Defaults to &lt;code&gt;en&lt;/code&gt;.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;delivery&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Details on how the reward is delivered to the recipient.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;method&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;How to deliver the reward to the recipient.&lt;/p&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Delivery Method&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;EMAIL&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Deliver the reward to the recipient by email&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;LINK&lt;/code&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;Deliver the reward to the recipient via a link.&lt;/p&gt; &lt;p&gt;The link can be retrieved on a successfully ordered reward via the &lt;code&gt;/rewards&lt;/code&gt; or &lt;code&gt;/rewards/id&lt;/code&gt; endpoint. That link must then be delivered to the recipient out-of-band.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;PHONE&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Deliver the reward to the recipient by SMS&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;meta&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Customizable reward delivery metadata, taking precedence over the related campaign settings.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;sender_name&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;The &amp;quot;sender name&amp;quot; used in the delivery. If it&amp;#39;s an email reward, &amp;quot;via Tremendous&amp;quot; will be appended to the value. Please note that you cannot customize the sender email.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;subject_line&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;The subject line used in the delivery.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;message&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;The content of the message of the reward, shown in the email / SMS and on the landing page.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a &quot;funding source&quot;. You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](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](tremendous.readme.io/reference/sandbox). The HTTP status code &#x60;200&#x60; on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it&#39;s recipient (for delivery method &#x60;EMAIL&#x60; and &#x60;PHONE&#x60;). 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 &#x60;external_id&#x60;, will result in a &#x60;201&#x60; response code. In this case the response will return a representation of the already existing order in the response body.

Parameters:

  • create_order_request (CreateOrderRequest)

    Order to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateOrder200Response, Integer, Hash)>)

    CreateOrder200Response data, response status code and response headers



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/tremendous/api/tremendous_api.rb', line 427

def create_order_with_http_info(create_order_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_order ...'
  end
  # verify the required parameter 'create_order_request' is set
  if @api_client.config.client_side_validation && create_order_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_order_request' when calling TremendousApi.create_order"
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_order_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_organization(create_organization_request, opts = {}) ⇒ CreateOrganization200Response

Create organization Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass ‘with_api_key` or `copy_settings` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.

Parameters:

  • create_organization_request (CreateOrganizationRequest)

    Organization details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



485
486
487
488
# File 'lib/tremendous/api/tremendous_api.rb', line 485

def create_organization(create_organization_request, opts = {})
  data, _status_code, _headers = create_organization_with_http_info(create_organization_request, opts)
  data
end

#create_organization_with_http_info(create_organization_request, opts = {}) ⇒ Array<(CreateOrganization200Response, Integer, Hash)>

Create organization Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass &#x60;with_api_key&#x60; or &#x60;copy_settings&#x60; in the request body as &#x60;true&#x60;. This ensures that your new Organization can either be accessed via the API or the Dashboard.

Parameters:

  • create_organization_request (CreateOrganizationRequest)

    Organization details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/tremendous/api/tremendous_api.rb', line 495

def create_organization_with_http_info(create_organization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_organization ...'
  end
  # verify the required parameter 'create_organization_request' is set
  if @api_client.config.client_side_validation && create_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_organization_request' when calling TremendousApi.create_organization"
  end
  # resource path
  local_var_path = '/organizations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_report(create_report_request, opts = {}) ⇒ CreateReport201Response

Create report Creating a report allows your organization to programmatically retrieve information that’s available in our dashboard UI. This request creates a new report object with a unique ID, and kicks off an async report generation. To retrieve a completed report, either poll ‘/api/v2/reports/id` or listen for REPORTS webhook event. ## 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">report_type</code> </div> </td><td><span class="property-type">string</span></td><td><p>Type of report for retrieval. <table> <thead> <tr> <th>Report type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>digital_rewards</td> <td>Report for Tremendous digital reward history</td> </tr> </tbody> </table></p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">format</code> </div> </td><td><span class="property-type">string</span></td><td><p>Format the report will be generated in. <table> <thead> <tr> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>csv</td> <td>CSV format for report</td> </tr> </tbody> </table></p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">filters</code> </div> </td><td><span class="property-type">object</span></td><td><p>Filters to apply to the report. Corresponds to the filters provided in the dashboard</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">digital_rewards</code> </div> </td><td><span class="property-type">object</span></td><td><p>Filters object for a report_type: digital_rewards report</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">amount</code> </div> </td><td><span class="property-type">object</span></td><td><p>Amount of the rewards returned in the report</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">gte</code> </div> </td><td><span class="property-type">number</span> <span class="property-format">double</span></td><td><p>Minimum amount of the rewards that should be returned in the report</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">lte</code> </div> </td><td><span class="property-type">number</span> <span class="property-format">double</span></td><td><p>Maximum amount of the rewards that should be returned in the report</p> </td></tr> </tbody> </table> </tr> <tr class=""><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 Tremendous campaign that this report should be limited to</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">created_at</code> </div> </td><td><span class="property-type">object</span></td><td><p>Creation dates of rewards returned in the report</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">gte</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date</span></td><td><p>Minimum date the reward was created</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">lte</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date</span></td><td><p>Maximum date the reward was created</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">delivered_at</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date</span></td><td><p>Delivery date for gifts that should be returned in the report</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">delivery_method</code> </div> </td><td><span class="property-type">string</span></td><td><p>Delivery method for rewards returned in the report</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">order_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>ID of the Tremendous order that this report should be limited to</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">order_status</code> </div> </td><td><span class="property-type">string</span></td><td><p>Order status for rewards returned in the report</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">status</code> </div> </td><td><span class="property-type">array</span> <span class="property-format">string</span></td><td><p>Status for rewards returned in the report</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ## Rate limits Some reports may take a long time to generate and we limit the number of reports that can be simultaneously generated by an organization at a given time. If you exceed the rate limit, you’ll receive a ‘429` response.

Parameters:

  • create_report_request (CreateReportRequest)

    Report to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



553
554
555
556
# File 'lib/tremendous/api/tremendous_api.rb', line 553

def create_report(create_report_request, opts = {})
  data, _status_code, _headers = create_report_with_http_info(create_report_request, opts)
  data
end

#create_report_with_http_info(create_report_request, opts = {}) ⇒ Array<(CreateReport201Response, Integer, Hash)>

Create report Creating a report allows your organization to programmatically retrieve information that&#39;s available in our dashboard UI. This request creates a new report object with a unique ID, and kicks off an async report generation. To retrieve a completed report, either poll &#x60;/api/v2/reports/id&#x60; or listen for REPORTS webhook event. ## Request body &lt;div class&#x3D;&quot;object-schema-request-schema&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;report_type&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Type of report for retrieval. &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Report type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;digital_rewards&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Report for Tremendous digital reward history&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;format&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Format the report will be generated in. &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Format&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;csv&lt;/code&gt;&lt;/td&gt; &lt;td&gt;CSV format for report&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;filters&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Filters to apply to the report. Corresponds to the filters provided in the dashboard&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;digital_rewards&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Filters object for a &lt;code&gt;report_type: digital_rewards&lt;/code&gt; report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;amount&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the rewards returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;gte&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Minimum amount of the rewards that should be returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;lte&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Maximum amount of the rewards that should be returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;campaign_id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;ID of the Tremendous campaign that this report should be limited to&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;created_at&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Creation dates of rewards returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;&quot;3&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;gte&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;date&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Minimum date the reward was created&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;lte&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;date&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Maximum date the reward was created&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;delivered_at&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;date&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Delivery date for gifts that should be returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;delivery_method&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Delivery method for rewards returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;order_id&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;ID of the Tremendous order that this report should be limited to&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;order_status&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Order status for rewards returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;status&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;array&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Status for rewards returned in the report&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; ## Rate limits Some reports may take a long time to generate and we limit the number of reports that can be simultaneously generated by an organization at a given time. If you exceed the rate limit, you&#39;ll receive a &#x60;429&#x60; response.

Parameters:

  • create_report_request (CreateReportRequest)

    Report to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateReport201Response, Integer, Hash)>)

    CreateReport201Response data, response status code and response headers



563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/tremendous/api/tremendous_api.rb', line 563

def create_report_with_http_info(create_report_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_report ...'
  end
  # verify the required parameter 'create_report_request' is set
  if @api_client.config.client_side_validation && create_report_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_report_request' when calling TremendousApi.create_report"
  end
  # resource path
  local_var_path = '/reports'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_report_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateReport201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_report",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_webhook(create_webhook_request, opts = {}) ⇒ CreateWebhook200Response

Create webhook 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>

Parameters:

  • create_webhook_request (CreateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



621
622
623
624
# File 'lib/tremendous/api/tremendous_api.rb', line 621

def create_webhook(create_webhook_request, opts = {})
  data, _status_code, _headers = create_webhook_with_http_info(create_webhook_request, opts)
  data
end

#create_webhook_with_http_info(create_webhook_request, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>

Create webhook Tremendous uses webhooks as a notification system for various events that happen in your account. &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [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 &lt;div class&#x3D;&quot;object-schema-request-schema&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;&quot;object-schema-table-body&quot;&gt; &lt;tr class&#x3D;&quot;&quot;&gt;&lt;td&gt;&lt;div class&#x3D;&quot;property-name&quot;&gt; &lt;code class&#x3D;&quot;property-name&quot;&gt;url&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;&quot;property-type&quot;&gt;string&lt;/span&gt; &lt;span class&#x3D;&quot;property-format&quot;&gt;uri&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;URL the webhook will make requests to&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;

Parameters:

  • create_webhook_request (CreateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateWebhook200Response, Integer, Hash)>)

    CreateWebhook200Response data, response status code and response headers



631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/tremendous/api/tremendous_api.rb', line 631

def create_webhook_with_http_info(create_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_webhook ...'
  end
  # verify the required parameter 'create_webhook_request' is set
  if @api_client.config.client_side_validation && create_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_webhook_request' when calling TremendousApi.create_webhook"
  end
  # resource path
  local_var_path = '/webhooks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateWebhook200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_fraud_rule(rule_type, opts = {}) ⇒ DeleteFraudRule200Response

Delete fraud rule Deletes the rule of the type passed in the URL.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



689
690
691
692
# File 'lib/tremendous/api/tremendous_api.rb', line 689

def delete_fraud_rule(rule_type, opts = {})
  data, _status_code, _headers = delete_fraud_rule_with_http_info(rule_type, opts)
  data
end

#delete_fraud_rule_with_http_info(rule_type, opts = {}) ⇒ Array<(DeleteFraudRule200Response, Integer, Hash)>

Delete fraud rule Deletes the rule of the type passed in the URL.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteFraudRule200Response, Integer, Hash)>)

    DeleteFraudRule200Response data, response status code and response headers



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
# File 'lib/tremendous/api/tremendous_api.rb', line 699

def delete_fraud_rule_with_http_info(rule_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_fraud_rule ...'
  end
  # verify the required parameter 'rule_type' is set
  if @api_client.config.client_side_validation && rule_type.nil?
    fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.delete_fraud_rule"
  end
  # verify enum value
  allowable_values = ["review_country", "review_ip", "review_email", "review_redeemed_rewards_count", "review_redeemed_rewards_amount", "review_multiple_emails", "review_vpn", "review_tremendous_flag_list", "review_previously_blocked_recipients", "allow_ip", "allow_email"]
  if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
    fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fraud_rules/{rule_type}'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteFraudRule200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_fraud_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_invoices(id, opts = {}) ⇒ CreateInvoice200Response

Delete invoice Removes an invoice. This has no further consequences but is a rather cosmetic operation.

Parameters:

  • id (String)

    ID of the invoice that should be removed

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



757
758
759
760
# File 'lib/tremendous/api/tremendous_api.rb', line 757

def delete_invoices(id, opts = {})
  data, _status_code, _headers = delete_invoices_with_http_info(id, opts)
  data
end

#delete_invoices_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>

Delete invoice Removes an invoice. This has no further consequences but is a rather cosmetic operation.

Parameters:

  • id (String)

    ID of the invoice that should be removed

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateInvoice200Response, Integer, Hash)>)

    CreateInvoice200Response data, response status code and response headers



767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
# File 'lib/tremendous/api/tremendous_api.rb', line 767

def delete_invoices_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_invoices ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_invoices"
  end
  # resource path
  local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateInvoice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_invoices",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_webhook(id, opts = {}) ⇒ nil

Delete webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


820
821
822
823
# File 'lib/tremendous/api/tremendous_api.rb', line 820

def delete_webhook(id, opts = {})
  delete_webhook_with_http_info(id, opts)
  nil
end

#delete_webhook_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete webhook &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
# File 'lib/tremendous/api/tremendous_api.rb', line 830

def delete_webhook_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_webhook"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_webhook, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_invoice_csv(id, opts = {}) ⇒ String

Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders

Parameters:

  • id (String)

    ID of the Invoice for that the CSV should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


888
889
890
891
# File 'lib/tremendous/api/tremendous_api.rb', line 888

def download_invoice_csv(id, opts = {})
  data, _status_code, _headers = download_invoice_csv_with_http_info(id, opts)
  data
end

#download_invoice_csv_with_http_info(id, opts = {}) ⇒ Array<(String, Integer, Hash)>

Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders

Parameters:

  • id (String)

    ID of the Invoice for that the CSV should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/tremendous/api/tremendous_api.rb', line 898

def download_invoice_csv_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_csv ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_csv"
  end
  # resource path
  local_var_path = '/invoices/{id}/csv'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.download_invoice_csv",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#download_invoice_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_invoice_pdf(id, opts = {}) ⇒ File

Retrieve invoice as PDF Generates a PDF version for an invoice

Parameters:

  • id (String)

    ID of the Invoice for that the PDF should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (File)


951
952
953
954
# File 'lib/tremendous/api/tremendous_api.rb', line 951

def download_invoice_pdf(id, opts = {})
  data, _status_code, _headers = download_invoice_pdf_with_http_info(id, opts)
  data
end

#download_invoice_pdf_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Retrieve invoice as PDF Generates a PDF version for an invoice

Parameters:

  • id (String)

    ID of the Invoice for that the PDF should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/tremendous/api/tremendous_api.rb', line 961

def download_invoice_pdf_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_pdf ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_pdf"
  end
  # resource path
  local_var_path = '/invoices/{id}/pdf'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.download_invoice_pdf",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#download_invoice_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fraud_rule(rule_type, opts = {}) ⇒ FraudRule200Response

Configure fraud rule Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fraud_rule_request (FraudRuleRequest)

    Rules &#x60;review_multiple_emails&#x60;, &#x60;review_vpn&#x60;, &#x60;review_tremendous_flaglist&#x60;, and &#x60;review_previously_blocked_recipients&#x60; require no body.

Returns:



1015
1016
1017
1018
# File 'lib/tremendous/api/tremendous_api.rb', line 1015

def fraud_rule(rule_type, opts = {})
  data, _status_code, _headers = fraud_rule_with_http_info(rule_type, opts)
  data
end

#fraud_rule_with_http_info(rule_type, opts = {}) ⇒ Array<(FraudRule200Response, Integer, Hash)>

Configure fraud rule Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fraud_rule_request (FraudRuleRequest)

    Rules &#x60;review_multiple_emails&#x60;, &#x60;review_vpn&#x60;, &#x60;review_tremendous_flaglist&#x60;, and &#x60;review_previously_blocked_recipients&#x60; require no body.

Returns:

  • (Array<(FraudRule200Response, Integer, Hash)>)

    FraudRule200Response data, response status code and response headers



1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/tremendous/api/tremendous_api.rb', line 1026

def fraud_rule_with_http_info(rule_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.fraud_rule ...'
  end
  # verify the required parameter 'rule_type' is set
  if @api_client.config.client_side_validation && rule_type.nil?
    fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.fraud_rule"
  end
  # verify enum value
  allowable_values = ["review_country", "review_ip", "review_email", "review_redeemed_rewards_count", "review_redeemed_rewards_amount", "review_multiple_emails", "review_vpn", "review_tremendous_flag_list", "review_previously_blocked_recipients", "allow_ip", "allow_email"]
  if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
    fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fraud_rules/{rule_type}'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'fraud_rule_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'FraudRule200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.fraud_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Generate a reward URL Generate a redemption link for the reward identified by the ‘id` in the URL

Parameters:

  • id (String)

    ID of the reward

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1089
1090
1091
1092
# File 'lib/tremendous/api/tremendous_api.rb', line 1089

def generate_reward_link(id, opts = {})
  data, _status_code, _headers = generate_reward_link_with_http_info(id, opts)
  data
end

Generate a reward URL Generate a redemption link for the reward identified by the &#x60;id&#x60; in the URL

Parameters:

  • id (String)

    ID of the reward

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/tremendous/api/tremendous_api.rb', line 1099

def generate_reward_link_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_link ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_link"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_link, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}/generate_link'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GenerateRewardLink200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.generate_reward_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#generate_reward_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_reward_token(id, opts = {}) ⇒ GenerateRewardToken200Response

Generate a reward token Generate a temporary reward token identified by the ‘id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.

Parameters:

  • id (String)

    ID of the reward

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1157
1158
1159
1160
# File 'lib/tremendous/api/tremendous_api.rb', line 1157

def generate_reward_token(id, opts = {})
  data, _status_code, _headers = generate_reward_token_with_http_info(id, opts)
  data
end

#generate_reward_token_with_http_info(id, opts = {}) ⇒ Array<(GenerateRewardToken200Response, Integer, Hash)>

Generate a reward token Generate a temporary reward token identified by the &#x60;id&#x60; in the URL. These tokens are needed to render a reward when using [Tremendous Embed](github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.

Parameters:

  • id (String)

    ID of the reward

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
# File 'lib/tremendous/api/tremendous_api.rb', line 1167

def generate_reward_token_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_token ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_token"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_token, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}/generate_embed_token'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GenerateRewardToken200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.generate_reward_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#generate_reward_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_campaign(id, opts = {}) ⇒ CreateCampaign201Response

Retrieve campaign Retrieve a campaign, identified by the given ‘id` in the URL

Parameters:

  • id (String)

    ID of the campaign that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1225
1226
1227
1228
# File 'lib/tremendous/api/tremendous_api.rb', line 1225

def get_campaign(id, opts = {})
  data, _status_code, _headers = get_campaign_with_http_info(id, opts)
  data
end

#get_campaign_with_http_info(id, opts = {}) ⇒ Array<(CreateCampaign201Response, Integer, Hash)>

Retrieve campaign Retrieve a campaign, identified by the given &#x60;id&#x60; in the URL

Parameters:

  • id (String)

    ID of the campaign that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateCampaign201Response, Integer, Hash)>)

    CreateCampaign201Response data, response status code and response headers



1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
# File 'lib/tremendous/api/tremendous_api.rb', line 1235

def get_campaign_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_campaign"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_campaign, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCampaign201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_campaign",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_fraud_review(id, opts = {}) ⇒ GetFraudReview200Response

Retrieve single fraud review Retrieve the details of a fraud review, identified by the given ‘id` in the URL. Returns additional details regarding the fraud review beyond what’s provided in the List fraud reviews endpoint, including reward details, recipient geolocation, etc.

Parameters:

  • id (String)

    The ID of the reward that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1293
1294
1295
1296
# File 'lib/tremendous/api/tremendous_api.rb', line 1293

def get_fraud_review(id, opts = {})
  data, _status_code, _headers = get_fraud_review_with_http_info(id, opts)
  data
end

#get_fraud_review_with_http_info(id, opts = {}) ⇒ Array<(GetFraudReview200Response, Integer, Hash)>

Retrieve single fraud review Retrieve the details of a fraud review, identified by the given &#x60;id&#x60; in the URL. Returns additional details regarding the fraud review beyond what&#39;s provided in the List fraud reviews endpoint, including reward details, recipient geolocation, etc.

Parameters:

  • id (String)

    The ID of the reward that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFraudReview200Response, Integer, Hash)>)

    GetFraudReview200Response data, response status code and response headers



1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
# File 'lib/tremendous/api/tremendous_api.rb', line 1303

def get_fraud_review_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_fraud_review ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_fraud_review"
  end
  # resource path
  local_var_path = '/fraud_reviews/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFraudReview200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_fraud_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_funding_source(id, opts = {}) ⇒ GetFundingSource200Response

Retrieve funding source Retrieve a funding source, identified by the given ‘id` in the URL

Parameters:

  • id (String)

    ID of the funding source that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1356
1357
1358
1359
# File 'lib/tremendous/api/tremendous_api.rb', line 1356

def get_funding_source(id, opts = {})
  data, _status_code, _headers = get_funding_source_with_http_info(id, opts)
  data
end

#get_funding_source_with_http_info(id, opts = {}) ⇒ Array<(GetFundingSource200Response, Integer, Hash)>

Retrieve funding source Retrieve a funding source, identified by the given &#x60;id&#x60; in the URL

Parameters:

  • id (String)

    ID of the funding source that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFundingSource200Response, Integer, Hash)>)

    GetFundingSource200Response data, response status code and response headers



1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/tremendous/api/tremendous_api.rb', line 1366

def get_funding_source_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_funding_source ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_funding_source"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_funding_source, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/funding_sources/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFundingSource200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_funding_source",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_funding_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice(id, opts = {}) ⇒ CreateInvoice200Response

Retrieve invoice Retrieve an invoice, identified by the given ‘id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.

Parameters:

  • id (String)

    ID of the invoice that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1424
1425
1426
1427
# File 'lib/tremendous/api/tremendous_api.rb', line 1424

def get_invoice(id, opts = {})
  data, _status_code, _headers = get_invoice_with_http_info(id, opts)
  data
end

#get_invoice_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>

Retrieve invoice Retrieve an invoice, identified by the given &#x60;id&#x60; in the URL &gt; 📘 Deleted Invoices &gt; &gt; This endpoint can be used to retrieve details on deleted invoices &gt; that the list of invoices omits.

Parameters:

  • id (String)

    ID of the invoice that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateInvoice200Response, Integer, Hash)>)

    CreateInvoice200Response data, response status code and response headers



1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
# File 'lib/tremendous/api/tremendous_api.rb', line 1434

def get_invoice_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_invoice ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_invoice"
  end
  # resource path
  local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateInvoice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_invoice",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_member(id, opts = {}) ⇒ GetMember200Response

Retrieve member

Parameters:

  • id (String)

    ID of the member to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1486
1487
1488
1489
# File 'lib/tremendous/api/tremendous_api.rb', line 1486

def get_member(id, opts = {})
  data, _status_code, _headers = get_member_with_http_info(id, opts)
  data
end

#get_member_with_http_info(id, opts = {}) ⇒ Array<(GetMember200Response, Integer, Hash)>

Retrieve member

Parameters:

  • id (String)

    ID of the member to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetMember200Response, Integer, Hash)>)

    GetMember200Response data, response status code and response headers



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
# File 'lib/tremendous/api/tremendous_api.rb', line 1495

def get_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_member ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_member"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_member, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_order(id, opts = {}) ⇒ GetOrder200Response

Retrieve order Retrieve the order, identified by the given ‘id` in the URL

Parameters:

  • id (String)

    ID of the order that should be retrieved. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1553
1554
1555
1556
# File 'lib/tremendous/api/tremendous_api.rb', line 1553

def get_order(id, opts = {})
  data, _status_code, _headers = get_order_with_http_info(id, opts)
  data
end

#get_order_with_http_info(id, opts = {}) ⇒ Array<(GetOrder200Response, Integer, Hash)>

Retrieve order Retrieve the order, identified by the given &#x60;id&#x60; in the URL

Parameters:

  • id (String)

    ID of the order that should be retrieved. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrder200Response, Integer, Hash)>)

    GetOrder200Response data, response status code and response headers



1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
# File 'lib/tremendous/api/tremendous_api.rb', line 1563

def get_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_order"
  end
  # resource path
  local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_organization(id, opts = {}) ⇒ GetOrganization200Response

Retrieve organization

Parameters:

  • id (String)

    ID of the organization to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1615
1616
1617
1618
# File 'lib/tremendous/api/tremendous_api.rb', line 1615

def get_organization(id, opts = {})
  data, _status_code, _headers = get_organization_with_http_info(id, opts)
  data
end

#get_organization_with_http_info(id, opts = {}) ⇒ Array<(GetOrganization200Response, Integer, Hash)>

Retrieve organization

Parameters:

  • id (String)

    ID of the organization to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrganization200Response, Integer, Hash)>)

    GetOrganization200Response data, response status code and response headers



1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
# File 'lib/tremendous/api/tremendous_api.rb', line 1624

def get_organization_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_organization ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_organization"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_organization, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_product(id, opts = {}) ⇒ GetProductResponse

Retrieve product Retrieve a product, identified by the given ‘id` in the URL

Parameters:

  • id (String)

    ID of the product that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1682
1683
1684
1685
# File 'lib/tremendous/api/tremendous_api.rb', line 1682

def get_product(id, opts = {})
  data, _status_code, _headers = get_product_with_http_info(id, opts)
  data
end

#get_product_with_http_info(id, opts = {}) ⇒ Array<(GetProductResponse, Integer, Hash)>

Retrieve product Retrieve a product, identified by the given &#x60;id&#x60; in the URL

Parameters:

  • id (String)

    ID of the product that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetProductResponse, Integer, Hash)>)

    GetProductResponse data, response status code and response headers



1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
# File 'lib/tremendous/api/tremendous_api.rb', line 1692

def get_product_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_product ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_product"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_product, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetProductResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_product",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_report(id, opts = {}) ⇒ CreateReport201Response

Retrieve report Retrieve the report, identified by the given ‘id` in the URL Using the ID that was returned by `POST /api/v2/reports`, retrieves a download link for the report, identified by the given ID in the URL. Returns the report’s current status and, if available, the URL for download. The URL is valid for 7 days.

Parameters:

  • id (String)

    ID of the report that should be retrieved. ID is returned from &#x60;POST&#x60; to /api/v2/reports

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1750
1751
1752
1753
# File 'lib/tremendous/api/tremendous_api.rb', line 1750

def get_report(id, opts = {})
  data, _status_code, _headers = get_report_with_http_info(id, opts)
  data
end

#get_report_with_http_info(id, opts = {}) ⇒ Array<(CreateReport201Response, Integer, Hash)>

Retrieve report Retrieve the report, identified by the given &#x60;id&#x60; in the URL Using the ID that was returned by &#x60;POST /api/v2/reports&#x60;, retrieves a download link for the report, identified by the given ID in the URL. Returns the report’s current status and, if available, the URL for download. The URL is valid for 7 days.

Parameters:

  • id (String)

    ID of the report that should be retrieved. ID is returned from &#x60;POST&#x60; to /api/v2/reports

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateReport201Response, Integer, Hash)>)

    CreateReport201Response data, response status code and response headers



1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
# File 'lib/tremendous/api/tremendous_api.rb', line 1760

def get_report_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_report ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_report"
  end
  # resource path
  local_var_path = '/reports/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateReport201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_report",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_reward(id, opts = {}) ⇒ GetReward200Response

Retrieve single reward Retrieve the reward, identified by the given ‘id` in the URL

Parameters:

  • id (String)

    ID of the reward that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1813
1814
1815
1816
# File 'lib/tremendous/api/tremendous_api.rb', line 1813

def get_reward(id, opts = {})
  data, _status_code, _headers = get_reward_with_http_info(id, opts)
  data
end

#get_reward_with_http_info(id, opts = {}) ⇒ Array<(GetReward200Response, Integer, Hash)>

Retrieve single reward Retrieve the reward, identified by the given &#x60;id&#x60; in the URL

Parameters:

  • id (String)

    ID of the reward that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetReward200Response, Integer, Hash)>)

    GetReward200Response data, response status code and response headers



1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
# File 'lib/tremendous/api/tremendous_api.rb', line 1823

def get_reward_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_reward ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_reward"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_reward, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetReward200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_reward",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_webhook(id, opts = {}) ⇒ CreateWebhook200Response

Retrieve webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1881
1882
1883
1884
# File 'lib/tremendous/api/tremendous_api.rb', line 1881

def get_webhook(id, opts = {})
  data, _status_code, _headers = get_webhook_with_http_info(id, opts)
  data
end

#get_webhook_with_http_info(id, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>

Retrieve webhook &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateWebhook200Response, Integer, Hash)>)

    CreateWebhook200Response data, response status code and response headers



1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
# File 'lib/tremendous/api/tremendous_api.rb', line 1891

def get_webhook_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_webhook"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_webhook, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateWebhook200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_balance_transactions(opts = {}) ⇒ ListBalanceTransactions200Response

List balance transactions Fetch a list of all balance transactions on your account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of transactions listed. The default value is 10.

  • :created_at_gte (String)

    Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

  • :created_at_lte (String)

    Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

Returns:



1952
1953
1954
1955
# File 'lib/tremendous/api/tremendous_api.rb', line 1952

def list_balance_transactions(opts = {})
  data, _status_code, _headers = list_balance_transactions_with_http_info(opts)
  data
end

#list_balance_transactions_with_http_info(opts = {}) ⇒ Array<(ListBalanceTransactions200Response, Integer, Hash)>

List balance transactions Fetch a list of all balance transactions on your account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of transactions listed. The default value is 10.

  • :created_at_gte (String)

    Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

  • :created_at_lte (String)

    Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

Returns:



1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
# File 'lib/tremendous/api/tremendous_api.rb', line 1965

def list_balance_transactions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_balance_transactions ...'
  end
  # resource path
  local_var_path = '/balance_transactions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListBalanceTransactions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_balance_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_balance_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_campaigns(opts = {}) ⇒ ListCampaigns200Response

List campaigns Retrieve a list of all campaigns created in your account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2017
2018
2019
2020
# File 'lib/tremendous/api/tremendous_api.rb', line 2017

def list_campaigns(opts = {})
  data, _status_code, _headers = list_campaigns_with_http_info(opts)
  data
end

#list_campaigns_with_http_info(opts = {}) ⇒ Array<(ListCampaigns200Response, Integer, Hash)>

List campaigns Retrieve a list of all campaigns created in your account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListCampaigns200Response, Integer, Hash)>)

    ListCampaigns200Response data, response status code and response headers



2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
# File 'lib/tremendous/api/tremendous_api.rb', line 2026

def list_campaigns_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_campaigns ...'
  end
  # resource path
  local_var_path = '/campaigns'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListCampaigns200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_campaigns",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fields(opts = {}) ⇒ ListFields200Response

List fields For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2074
2075
2076
2077
# File 'lib/tremendous/api/tremendous_api.rb', line 2074

def list_fields(opts = {})
  data, _status_code, _headers = list_fields_with_http_info(opts)
  data
end

#list_fields_with_http_info(opts = {}) ⇒ Array<(ListFields200Response, Integer, Hash)>

List fields For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListFields200Response, Integer, Hash)>)

    ListFields200Response data, response status code and response headers



2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
# File 'lib/tremendous/api/tremendous_api.rb', line 2083

def list_fields_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_fields ...'
  end
  # resource path
  local_var_path = '/fields'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFields200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_fields",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_forex(opts = {}) ⇒ ListForexResponse

List exchange rates Retrieve a list of exchange rates

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :base (String)

    Base currency code, default is USD.

Returns:



2132
2133
2134
2135
# File 'lib/tremendous/api/tremendous_api.rb', line 2132

def list_forex(opts = {})
  data, _status_code, _headers = list_forex_with_http_info(opts)
  data
end

#list_forex_with_http_info(opts = {}) ⇒ Array<(ListForexResponse, Integer, Hash)>

List exchange rates Retrieve a list of exchange rates

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :base (String)

    Base currency code, default is USD.

Returns:

  • (Array<(ListForexResponse, Integer, Hash)>)

    ListForexResponse data, response status code and response headers



2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
# File 'lib/tremendous/api/tremendous_api.rb', line 2142

def list_forex_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_forex ...'
  end
  # resource path
  local_var_path = '/forex'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListForexResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_forex",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_forex\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fraud_reviews(opts = {}) ⇒ ListFraudReviews200Response

List fraud reviews Retrieve a paginated list of all fraud reviews. List can be filtered by status, created or redeemed at dates.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of records. The returned fraud reviews are ordered (and offsetted) by their redemption date (DESC).

  • :limit (Integer)

    Limits the number of fraud reviews listed. The default value is 10.

  • :status (String)

    Filters fraud reviews by status. Can be &#x60;flagged&#x60;, &#x60;blocked&#x60; or &#x60;released&#x60;.

  • :created_at_gte (String)

    Return results where the created_at field is &gt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.

  • :created_at_lte (String)

    Return results where the created_at field is &lt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_gte (String)

    Return results where the redeemed_at field is &gt;&#x3D; the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_lte (String)

    Return results where the redeemed_at field is &lt;&#x3D; the supplied value. Expects an ISO 8601 datetime.

Returns:



2198
2199
2200
2201
# File 'lib/tremendous/api/tremendous_api.rb', line 2198

def list_fraud_reviews(opts = {})
  data, _status_code, _headers = list_fraud_reviews_with_http_info(opts)
  data
end

#list_fraud_reviews_with_http_info(opts = {}) ⇒ Array<(ListFraudReviews200Response, Integer, Hash)>

List fraud reviews Retrieve a paginated list of all fraud reviews. List can be filtered by status, created or redeemed at dates.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of records. The returned fraud reviews are ordered (and offsetted) by their redemption date (DESC).

  • :limit (Integer)

    Limits the number of fraud reviews listed. The default value is 10.

  • :status (String)

    Filters fraud reviews by status. Can be &#x60;flagged&#x60;, &#x60;blocked&#x60; or &#x60;released&#x60;.

  • :created_at_gte (String)

    Return results where the created_at field is &gt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.

  • :created_at_lte (String)

    Return results where the created_at field is &lt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_gte (String)

    Return results where the redeemed_at field is &gt;&#x3D; the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_lte (String)

    Return results where the redeemed_at field is &lt;&#x3D; the supplied value. Expects an ISO 8601 datetime.

Returns:

  • (Array<(ListFraudReviews200Response, Integer, Hash)>)

    ListFraudReviews200Response data, response status code and response headers



2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
# File 'lib/tremendous/api/tremendous_api.rb', line 2214

def list_fraud_reviews_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_reviews ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TremendousApi.list_fraud_reviews, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TremendousApi.list_fraud_reviews, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TremendousApi.list_fraud_reviews, must be greater than or equal to 1.'
  end

  allowable_values = ["flagged", "blocked", "released"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fraud_reviews'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
  query_params[:'redeemed_at[gte]'] = opts[:'redeemed_at_gte'] if !opts[:'redeemed_at_gte'].nil?
  query_params[:'redeemed_at[lte]'] = opts[:'redeemed_at_lte'] if !opts[:'redeemed_at_lte'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFraudReviews200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_fraud_reviews",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_fraud_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fraud_rules(opts = {}) ⇒ ListFraudRules200Response

List fraud rules List active fraud rules associated with the organization tied to your API key.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2285
2286
2287
2288
# File 'lib/tremendous/api/tremendous_api.rb', line 2285

def list_fraud_rules(opts = {})
  data, _status_code, _headers = list_fraud_rules_with_http_info(opts)
  data
end

#list_fraud_rules_with_http_info(opts = {}) ⇒ Array<(ListFraudRules200Response, Integer, Hash)>

List fraud rules List active fraud rules associated with the organization tied to your API key.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListFraudRules200Response, Integer, Hash)>)

    ListFraudRules200Response data, response status code and response headers



2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
# File 'lib/tremendous/api/tremendous_api.rb', line 2294

def list_fraud_rules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_rules ...'
  end
  # resource path
  local_var_path = '/fraud_rules'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFraudRules200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_fraud_rules",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_fraud_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_funding_sources(opts = {}) ⇒ ListFundingSources200Response

List funding sources Retrieve a list of all funding sources available for ordering through the API in your organization’s account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2342
2343
2344
2345
# File 'lib/tremendous/api/tremendous_api.rb', line 2342

def list_funding_sources(opts = {})
  data, _status_code, _headers = list_funding_sources_with_http_info(opts)
  data
end

#list_funding_sources_with_http_info(opts = {}) ⇒ Array<(ListFundingSources200Response, Integer, Hash)>

List funding sources Retrieve a list of all funding sources available for ordering through the API in your organization&#39;s account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
# File 'lib/tremendous/api/tremendous_api.rb', line 2351

def list_funding_sources_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_funding_sources ...'
  end
  # resource path
  local_var_path = '/funding_sources'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFundingSources200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_funding_sources",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_funding_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_invoices(opts = {}) ⇒ ListInvoices200Response

List invoices Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of invoices listed. The maximum and default value is 10.

Returns:



2401
2402
2403
2404
# File 'lib/tremendous/api/tremendous_api.rb', line 2401

def list_invoices(opts = {})
  data, _status_code, _headers = list_invoices_with_http_info(opts)
  data
end

#list_invoices_with_http_info(opts = {}) ⇒ Array<(ListInvoices200Response, Integer, Hash)>

List invoices Fetch a list of all invoices on your account. &gt; 🚧 Deleted invoices are omitted &gt; &gt; The response does not include any previously deleted invoices.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of invoices listed. The maximum and default value is 10.

Returns:

  • (Array<(ListInvoices200Response, Integer, Hash)>)

    ListInvoices200Response data, response status code and response headers



2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
# File 'lib/tremendous/api/tremendous_api.rb', line 2412

def list_invoices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_invoices ...'
  end
  # resource path
  local_var_path = '/invoices'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListInvoices200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_invoices",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_members(opts = {}) ⇒ ListMembers200Response

List members To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2462
2463
2464
2465
# File 'lib/tremendous/api/tremendous_api.rb', line 2462

def list_members(opts = {})
  data, _status_code, _headers = list_members_with_http_info(opts)
  data
end

#list_members_with_http_info(opts = {}) ⇒ Array<(ListMembers200Response, Integer, Hash)>

List members To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListMembers200Response, Integer, Hash)>)

    ListMembers200Response data, response status code and response headers



2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
# File 'lib/tremendous/api/tremendous_api.rb', line 2471

def list_members_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_members ...'
  end
  # resource path
  local_var_path = '/members'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListMembers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_members",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_orders(opts = {}) ⇒ ListOrders200Response

List orders Retrieve a list of orders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).

  • :campaign_id (String)

    Only return results with a matching campaign_id.

  • :external_id (String)

    Only return results with a matching external_id.

  • :created_at_gte (String)

    Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

  • :created_at_lte (String)

    Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

  • :limit (Integer)

    Limits the number of orders listed. The maximum value is 100 and the default is 10.

Returns:



2525
2526
2527
2528
# File 'lib/tremendous/api/tremendous_api.rb', line 2525

def list_orders(opts = {})
  data, _status_code, _headers = list_orders_with_http_info(opts)
  data
end

#list_orders_with_http_info(opts = {}) ⇒ Array<(ListOrders200Response, Integer, Hash)>

List orders Retrieve a list of orders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).

  • :campaign_id (String)

    Only return results with a matching campaign_id.

  • :external_id (String)

    Only return results with a matching external_id.

  • :created_at_gte (String)

    Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

  • :created_at_lte (String)

    Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.

  • :limit (Integer)

    Limits the number of orders listed. The maximum value is 100 and the default is 10.

Returns:

  • (Array<(ListOrders200Response, Integer, Hash)>)

    ListOrders200Response data, response status code and response headers



2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
# File 'lib/tremendous/api/tremendous_api.rb', line 2540

def list_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_orders ...'
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
  query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListOrders200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_orders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_organizations(opts = {}) ⇒ ListOrganizations200Response

List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2594
2595
2596
2597
# File 'lib/tremendous/api/tremendous_api.rb', line 2594

def list_organizations(opts = {})
  data, _status_code, _headers = list_organizations_with_http_info(opts)
  data
end

#list_organizations_with_http_info(opts = {}) ⇒ Array<(ListOrganizations200Response, Integer, Hash)>

List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
# File 'lib/tremendous/api/tremendous_api.rb', line 2603

def list_organizations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_organizations ...'
  end
  # resource path
  local_var_path = '/organizations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListOrganizations200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_organizations",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_products(opts = {}) ⇒ ListProductsResponse

List products Retrieve a list of available products

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String)

    Comma-separated list of [Alpha-2 country codes](www.iban.com/country-codes), used to only retrieve products available in the provided countries

  • :currency (String)

    Comma-separated list of [currency codes](www.iban.com/currency-codes), used to only retrieve products available in the provided currencies

Returns:



2653
2654
2655
2656
# File 'lib/tremendous/api/tremendous_api.rb', line 2653

def list_products(opts = {})
  data, _status_code, _headers = list_products_with_http_info(opts)
  data
end

#list_products_with_http_info(opts = {}) ⇒ Array<(ListProductsResponse, Integer, Hash)>

List products Retrieve a list of available products

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String)

    Comma-separated list of [Alpha-2 country codes](www.iban.com/country-codes), used to only retrieve products available in the provided countries

  • :currency (String)

    Comma-separated list of [currency codes](www.iban.com/currency-codes), used to only retrieve products available in the provided currencies

Returns:

  • (Array<(ListProductsResponse, Integer, Hash)>)

    ListProductsResponse data, response status code and response headers



2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
# File 'lib/tremendous/api/tremendous_api.rb', line 2664

def list_products_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_products ...'
  end
  # resource path
  local_var_path = '/products'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListProductsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_products",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_rewards(opts = {}) ⇒ ListRewards200Response

List rewards Retrieve a list of all created rewards

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).

Returns:



2715
2716
2717
2718
# File 'lib/tremendous/api/tremendous_api.rb', line 2715

def list_rewards(opts = {})
  data, _status_code, _headers = list_rewards_with_http_info(opts)
  data
end

#list_rewards_with_http_info(opts = {}) ⇒ Array<(ListRewards200Response, Integer, Hash)>

List rewards Retrieve a list of all created rewards

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).

Returns:

  • (Array<(ListRewards200Response, Integer, Hash)>)

    ListRewards200Response data, response status code and response headers



2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
# File 'lib/tremendous/api/tremendous_api.rb', line 2725

def list_rewards_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_rewards ...'
  end
  # resource path
  local_var_path = '/rewards'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListRewards200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_rewards",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_roles(opts = {}) ⇒ ListRoles200Response

List roles List all available roles in the organization.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2774
2775
2776
2777
# File 'lib/tremendous/api/tremendous_api.rb', line 2774

def list_roles(opts = {})
  data, _status_code, _headers = list_roles_with_http_info(opts)
  data
end

#list_roles_with_http_info(opts = {}) ⇒ Array<(ListRoles200Response, Integer, Hash)>

List roles List all available roles in the organization.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListRoles200Response, Integer, Hash)>)

    ListRoles200Response data, response status code and response headers



2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
# File 'lib/tremendous/api/tremendous_api.rb', line 2783

def list_roles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_roles ...'
  end
  # resource path
  local_var_path = '/roles'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListRoles200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_roles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_webhook_events(id, opts = {}) ⇒ ListWebhookEvents200Response

List events 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)

Parameters:

  • id (String)

    ID of the webhook to list the events for

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2832
2833
2834
2835
# File 'lib/tremendous/api/tremendous_api.rb', line 2832

def list_webhook_events(id, opts = {})
  data, _status_code, _headers = list_webhook_events_with_http_info(id, opts)
  data
end

#list_webhook_events_with_http_info(id, opts = {}) ⇒ Array<(ListWebhookEvents200Response, Integer, Hash)>

List events Lists all event types that can be sent to the configured webhook endpoint. &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to list the events for

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
# File 'lib/tremendous/api/tremendous_api.rb', line 2842

def list_webhook_events_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhook_events ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.list_webhook_events"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.list_webhook_events, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/webhooks/{id}/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListWebhookEvents200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_webhook_events",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_webhook_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_webhooks(opts = {}) ⇒ ListWebhooks200Response

List webhooks Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2899
2900
2901
2902
# File 'lib/tremendous/api/tremendous_api.rb', line 2899

def list_webhooks(opts = {})
  data, _status_code, _headers = list_webhooks_with_http_info(opts)
  data
end

#list_webhooks_with_http_info(opts = {}) ⇒ Array<(ListWebhooks200Response, Integer, Hash)>

List webhooks Every organization can only have one webhook. This endpoint shows the details about that webhook. &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListWebhooks200Response, Integer, Hash)>)

    ListWebhooks200Response data, response status code and response headers



2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
# File 'lib/tremendous/api/tremendous_api.rb', line 2908

def list_webhooks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhooks ...'
  end
  # resource path
  local_var_path = '/webhooks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListWebhooks200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_webhooks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reject_order(id, opts = {}) ⇒ GetOrder200Response

Reject order Rejects an order that is pending review, identified by the given ‘id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable ’Allow approvals via API’ via the organization”s ‘Order Approvals’ settings from the Tremendous dashboard.

Parameters:

  • id (String)

    ID of the order that should be rejected. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2957
2958
2959
2960
# File 'lib/tremendous/api/tremendous_api.rb', line 2957

def reject_order(id, opts = {})
  data, _status_code, _headers = reject_order_with_http_info(id, opts)
  data
end

#reject_order_with_http_info(id, opts = {}) ⇒ Array<(GetOrder200Response, Integer, Hash)>

Reject order Rejects an order that is pending review, identified by the given &#x60;id&#x60; in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable &#39;Allow approvals via API&#39; via the organization&#39;&#39;s &#39;Order Approvals&#39; settings from the Tremendous dashboard.

Parameters:

  • id (String)

    ID of the order that should be rejected. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrder200Response, Integer, Hash)>)

    GetOrder200Response data, response status code and response headers



2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
# File 'lib/tremendous/api/tremendous_api.rb', line 2967

def reject_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.reject_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.reject_order"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.reject_order, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/order_approvals/{id}/reject'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.reject_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#reject_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#release_fraud_review(id, opts = {}) ⇒ GetFraudReview200Response

Release fraud review Completes the fraud review identified by the given ‘id` in the URL, and releases the associated reward to the recipient.

Parameters:

  • id (String)

    The ID of the reward that should be released.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3025
3026
3027
3028
# File 'lib/tremendous/api/tremendous_api.rb', line 3025

def release_fraud_review(id, opts = {})
  data, _status_code, _headers = release_fraud_review_with_http_info(id, opts)
  data
end

#release_fraud_review_with_http_info(id, opts = {}) ⇒ Array<(GetFraudReview200Response, Integer, Hash)>

Release fraud review Completes the fraud review identified by the given &#x60;id&#x60; in the URL, and releases the associated reward to the recipient.

Parameters:

  • id (String)

    The ID of the reward that should be released.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFraudReview200Response, Integer, Hash)>)

    GetFraudReview200Response data, response status code and response headers



3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
# File 'lib/tremendous/api/tremendous_api.rb', line 3035

def release_fraud_review_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.release_fraud_review ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.release_fraud_review"
  end
  # resource path
  local_var_path = '/fraud_reviews/{id}/release'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFraudReview200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.release_fraud_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#release_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resend_reward(id, opts = {}) ⇒ Object

Resend reward Resends a reward, identified by the given ‘id` in the URL, to its recipient.

Parameters:

  • id (String)

    ID of the reward that should be resent

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :resend_reward_request (ResendRewardRequest)

    Only for rewards with a previous delivery failure: You can update the email or phone number used for the resend. You can only provide one of &#x60;updated_email&#x60; or &#x60;updated_phone&#x60;, not both.

Returns:

  • (Object)


3089
3090
3091
3092
# File 'lib/tremendous/api/tremendous_api.rb', line 3089

def resend_reward(id, opts = {})
  data, _status_code, _headers = resend_reward_with_http_info(id, opts)
  data
end

#resend_reward_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Resend reward Resends a reward, identified by the given &#x60;id&#x60; in the URL, to its recipient.

Parameters:

  • id (String)

    ID of the reward that should be resent

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :resend_reward_request (ResendRewardRequest)

    Only for rewards with a previous delivery failure: You can update the email or phone number used for the resend. You can only provide one of &#x60;updated_email&#x60; or &#x60;updated_phone&#x60;, not both.

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
# File 'lib/tremendous/api/tremendous_api.rb', line 3100

def resend_reward_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.resend_reward ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.resend_reward"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.resend_reward, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}/resend'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'resend_reward_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.resend_reward",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#resend_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#simulate_webhook(id, simulate_webhook_request, opts = {}) ⇒ String

Test webhook Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to test

  • simulate_webhook_request (SimulateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


3164
3165
3166
3167
# File 'lib/tremendous/api/tremendous_api.rb', line 3164

def simulate_webhook(id, simulate_webhook_request, opts = {})
  data, _status_code, _headers = simulate_webhook_with_http_info(id, simulate_webhook_request, opts)
  data
end

#simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {}) ⇒ Array<(String, Integer, Hash)>

Test webhook Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)

Parameters:

  • id (String)

    ID of the webhook to test

  • simulate_webhook_request (SimulateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
# File 'lib/tremendous/api/tremendous_api.rb', line 3175

def simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.simulate_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.simulate_webhook"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.simulate_webhook, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'simulate_webhook_request' is set
  if @api_client.config.client_side_validation && simulate_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'simulate_webhook_request' when calling TremendousApi.simulate_webhook"
  end
  # resource path
  local_var_path = '/webhooks/{id}/simulate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/html', 'application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(simulate_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.simulate_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#simulate_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_campaign(id, update_campaign_request, opts = {}) ⇒ CreateCampaign201Response

Update campaign

Parameters:

  • id (String)

    ID of the campaign that should be updated

  • update_campaign_request (UpdateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3242
3243
3244
3245
# File 'lib/tremendous/api/tremendous_api.rb', line 3242

def update_campaign(id, update_campaign_request, opts = {})
  data, _status_code, _headers = update_campaign_with_http_info(id, update_campaign_request, opts)
  data
end

#update_campaign_with_http_info(id, update_campaign_request, opts = {}) ⇒ Array<(CreateCampaign201Response, Integer, Hash)>

Update campaign

Parameters:

  • id (String)

    ID of the campaign that should be updated

  • update_campaign_request (UpdateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateCampaign201Response, Integer, Hash)>)

    CreateCampaign201Response data, response status code and response headers



3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
# File 'lib/tremendous/api/tremendous_api.rb', line 3252

def update_campaign_with_http_info(id, update_campaign_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_campaign"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'update_campaign_request' is set
  if @api_client.config.client_side_validation && update_campaign_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_campaign_request' when calling TremendousApi.update_campaign"
  end
  # resource path
  local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCampaign201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.update_campaign",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_fraud_rule_list(rule_type, update_fraud_rule_list_request, opts = {}) ⇒ UpdateFraudRuleList200Response

Update fraud rule list Use this endpoint to modify a list associated with an already-configured rule. Add and remove operations supported. For example, to append new IPs to the ‘review_ip` rule, a valid JSON body would be: “`json { "operation": "add", "config": { "ips": ["123.123.123.123"] } } “`

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • update_fraud_rule_list_request (UpdateFraudRuleListRequest)

    The lists to add or remove from the current configuration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3320
3321
3322
3323
# File 'lib/tremendous/api/tremendous_api.rb', line 3320

def update_fraud_rule_list(rule_type, update_fraud_rule_list_request, opts = {})
  data, _status_code, _headers = update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts)
  data
end

#update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts = {}) ⇒ Array<(UpdateFraudRuleList200Response, Integer, Hash)>

Update fraud rule list Use this endpoint to modify a list associated with an already-configured rule. Add and remove operations supported. For example, to append new IPs to the &#x60;review_ip&#x60; rule, a valid JSON body would be: &#x60;&#x60;&#x60;json { &quot;operation&quot;: &quot;add&quot;, &quot;config&quot;: { &quot;ips&quot;: [&quot;123.123.123.123&quot;] } } &#x60;&#x60;&#x60;

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • update_fraud_rule_list_request (UpdateFraudRuleListRequest)

    The lists to add or remove from the current configuration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
# File 'lib/tremendous/api/tremendous_api.rb', line 3331

def update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.update_fraud_rule_list ...'
  end
  # verify the required parameter 'rule_type' is set
  if @api_client.config.client_side_validation && rule_type.nil?
    fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.update_fraud_rule_list"
  end
  # verify enum value
  allowable_values = ["review_country", "review_ip", "review_email", "allow_ip", "allow_email"]
  if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
    fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'update_fraud_rule_list_request' is set
  if @api_client.config.client_side_validation && update_fraud_rule_list_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_fraud_rule_list_request' when calling TremendousApi.update_fraud_rule_list"
  end
  # resource path
  local_var_path = '/fraud_rules/{rule_type}/update_list'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_fraud_rule_list_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateFraudRuleList200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.update_fraud_rule_list",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#update_fraud_rule_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end