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 = {}) ⇒ CreateOrder201Response

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<(CreateOrder201Response, 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<(CreateOrder201Response, Integer, Hash)>)

    CreateOrder201Response 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'])

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

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

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

  # 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

#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:



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

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



103
104
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
# File 'lib/tremendous/api/tremendous_api.rb', line 103

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'])

  # 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:



151
152
153
154
# File 'lib/tremendous/api/tremendous_api.rb', line 151

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



160
161
162
163
164
165
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
209
210
211
# File 'lib/tremendous/api/tremendous_api.rb', line 160

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'])
  # 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:



218
219
220
221
# File 'lib/tremendous/api/tremendous_api.rb', line 218

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



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
275
276
277
278
279
# File 'lib/tremendous/api/tremendous_api.rb', line 228

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'])
  # 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:



286
287
288
289
# File 'lib/tremendous/api/tremendous_api.rb', line 286

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



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
343
344
345
346
347
# File 'lib/tremendous/api/tremendous_api.rb', line 296

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'])
  # 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> </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:



354
355
356
357
# File 'lib/tremendous/api/tremendous_api.rb', line 354

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;/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



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
411
412
413
414
415
# File 'lib/tremendous/api/tremendous_api.rb', line 364

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'])
  # 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:



422
423
424
425
# File 'lib/tremendous/api/tremendous_api.rb', line 422

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:



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
479
480
481
482
483
# File 'lib/tremendous/api/tremendous_api.rb', line 432

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'])
  # 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_public_key(create_public_key_request, opts = {}) ⇒ CreatePublicKey200Response

Create public key Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > ‘openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub` <div class="object-schema-request-schema"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">public_key</code> </div> </td><td><span class="property-type">string</span></td><td><p>Base64 encoded (public) PEM file</p> </td></tr> </tbody> </table> </div>

Parameters:

  • create_public_key_request (CreatePublicKeyRequest)

    Public key details

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

    the optional parameters

Returns:



490
491
492
493
# File 'lib/tremendous/api/tremendous_api.rb', line 490

def create_public_key(create_public_key_request, opts = {})
  data, _status_code, _headers = create_public_key_with_http_info(create_public_key_request, opts)
  data
end

#create_public_key_with_http_info(create_public_key_request, opts = {}) ⇒ Array<(CreatePublicKey200Response, Integer, Hash)>

Create public key Creating a public key is the way for your organization to share it with Tremendous. &gt; 🔒 Generating asymmetric keys &gt; &gt; **We recommend using [OpenSSL](www.openssl.org/).** &gt; &gt; 1. Generate a private key and a public key in PEM: &gt; &#x60;openssl genrsa -out tremendous_key.pem 4096&#x60; &gt; &gt; 2. Extract the public key in PEM format: &gt; &#x60;openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub&#x60; &gt; &gt; 3. And, before making your request, encode it as a &#x60;base64&#x60; string: &gt; &#x60;base64 -i tremendous_key.pem.pub&#x60; &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;public_key&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;Base64 encoded (public) PEM file&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;

Parameters:

  • create_public_key_request (CreatePublicKeyRequest)

    Public key details

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

    the optional parameters

Returns:

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

    CreatePublicKey200Response data, response status code and response headers



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
547
548
549
550
551
# File 'lib/tremendous/api/tremendous_api.rb', line 500

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

  # 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'])
  # 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_public_key_request)

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

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

  new_options = opts.merge(
    :operation => :"TremendousApi.create_public_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_public_key\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:



558
559
560
561
# File 'lib/tremendous/api/tremendous_api.rb', line 558

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



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
615
616
617
618
619
# File 'lib/tremendous/api/tremendous_api.rb', line 568

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'])
  # 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_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:



626
627
628
629
# File 'lib/tremendous/api/tremendous_api.rb', line 626

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



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 636

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'])

  # 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_public_key(id, opts = {}) ⇒ nil

Delete public key Deactivates a public key. Any further attempt to verify a request signature with this key will fail.

Parameters:

  • id (String)

    ID of the public key that should be deactivated

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

    the optional parameters

Returns:

  • (nil)


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

def delete_public_key(id, opts = {})
  delete_public_key_with_http_info(id, opts)
  nil
end

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

Delete public key Deactivates a public key. Any further attempt to verify a request signature with this key will fail.

Parameters:

  • id (String)

    ID of the public key that should be deactivated

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

    the optional parameters

Returns:

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

    nil, 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_public_key_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_public_key ...'
  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_public_key"
  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_public_key, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/public_keys/{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'])

  # 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_public_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_public_key\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)


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

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



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
814
815
816
817
818
# File 'lib/tremendous/api/tremendous_api.rb', line 767

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'])

  # 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)


825
826
827
828
# File 'lib/tremendous/api/tremendous_api.rb', line 825

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



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 835

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'])

  # 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)


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

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



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_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'])

  # 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

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:



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

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:



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
1008
1009
1010
1011
1012
# File 'lib/tremendous/api/tremendous_api.rb', line 961

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'])

  # 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:



1019
1020
1021
1022
# File 'lib/tremendous/api/tremendous_api.rb', line 1019

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:



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
# File 'lib/tremendous/api/tremendous_api.rb', line 1029

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'])

  # 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:



1087
1088
1089
1090
# File 'lib/tremendous/api/tremendous_api.rb', line 1087

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



1097
1098
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1097

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'])

  # 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_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:



1155
1156
1157
1158
# File 'lib/tremendous/api/tremendous_api.rb', line 1155

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



1165
1166
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1165

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'])

  # 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:



1223
1224
1225
1226
# File 'lib/tremendous/api/tremendous_api.rb', line 1223

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



1233
1234
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1233

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'])

  # 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:



1285
1286
1287
1288
# File 'lib/tremendous/api/tremendous_api.rb', line 1285

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



1294
1295
1296
1297
1298
1299
1300
1301
1302
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1294

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'])

  # 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 = {}) ⇒ CreateOrder201Response

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:



1352
1353
1354
1355
# File 'lib/tremendous/api/tremendous_api.rb', line 1352

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<(CreateOrder201Response, 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<(CreateOrder201Response, Integer, Hash)>)

    CreateOrder201Response data, response status code and response headers



1362
1363
1364
1365
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1362

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'])

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

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

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

  # 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:



1414
1415
1416
1417
# File 'lib/tremendous/api/tremendous_api.rb', line 1414

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



1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1423

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'])

  # 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:



1481
1482
1483
1484
# File 'lib/tremendous/api/tremendous_api.rb', line 1481

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



1491
1492
1493
1494
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1491

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'])

  # 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_public_key(id, opts = {}) ⇒ CreatePublicKey200Response

Retrieve public key Retrieve an active public key, identified by the given ‘id` in the URL.

Parameters:

  • id (String)

    ID of the public key that should be retrieved

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

    the optional parameters

Returns:



1549
1550
1551
1552
# File 'lib/tremendous/api/tremendous_api.rb', line 1549

def get_public_key(id, opts = {})
  data, _status_code, _headers = get_public_key_with_http_info(id, opts)
  data
end

#get_public_key_with_http_info(id, opts = {}) ⇒ Array<(CreatePublicKey200Response, Integer, Hash)>

Retrieve public key Retrieve an active public key, identified by the given &#x60;id&#x60; in the URL.

Parameters:

  • id (String)

    ID of the public key that should be retrieved

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

    the optional parameters

Returns:

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

    CreatePublicKey200Response data, response status code and response headers



1559
1560
1561
1562
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
1610
# File 'lib/tremendous/api/tremendous_api.rb', line 1559

def get_public_key_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_public_key ...'
  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_public_key"
  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_public_key, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/public_keys/{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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"TremendousApi.get_public_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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_public_key\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:



1617
1618
1619
1620
# File 'lib/tremendous/api/tremendous_api.rb', line 1617

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



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
1676
1677
1678
# File 'lib/tremendous/api/tremendous_api.rb', line 1627

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'])

  # 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:



1685
1686
1687
1688
# File 'lib/tremendous/api/tremendous_api.rb', line 1685

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



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
1744
1745
1746
# File 'lib/tremendous/api/tremendous_api.rb', line 1695

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'])

  # 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:



1756
1757
1758
1759
# File 'lib/tremendous/api/tremendous_api.rb', line 1756

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:



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
1807
1808
1809
1810
1811
1812
1813
1814
1815
# File 'lib/tremendous/api/tremendous_api.rb', line 1769

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'])

  # 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:



1821
1822
1823
1824
# File 'lib/tremendous/api/tremendous_api.rb', line 1821

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



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
# File 'lib/tremendous/api/tremendous_api.rb', line 1830

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'])

  # 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:



1878
1879
1880
1881
# File 'lib/tremendous/api/tremendous_api.rb', line 1878

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



1887
1888
1889
1890
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1887

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'])

  # 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:



1936
1937
1938
1939
# File 'lib/tremendous/api/tremendous_api.rb', line 1936

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



1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
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
# File 'lib/tremendous/api/tremendous_api.rb', line 1946

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'])

  # 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_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:



1995
1996
1997
1998
# File 'lib/tremendous/api/tremendous_api.rb', line 1995

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:



2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
# File 'lib/tremendous/api/tremendous_api.rb', line 2004

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'])

  # 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:



2054
2055
2056
2057
# File 'lib/tremendous/api/tremendous_api.rb', line 2054

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



2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
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
# File 'lib/tremendous/api/tremendous_api.rb', line 2065

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'])

  # 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:



2115
2116
2117
2118
# File 'lib/tremendous/api/tremendous_api.rb', line 2115

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



2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
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
# File 'lib/tremendous/api/tremendous_api.rb', line 2124

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'])

  # 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:



2178
2179
2180
2181
# File 'lib/tremendous/api/tremendous_api.rb', line 2178

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



2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
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
# File 'lib/tremendous/api/tremendous_api.rb', line 2193

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'])

  # 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:



2247
2248
2249
2250
# File 'lib/tremendous/api/tremendous_api.rb', line 2247

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:



2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
# File 'lib/tremendous/api/tremendous_api.rb', line 2256

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'])

  # 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:



2306
2307
2308
2309
# File 'lib/tremendous/api/tremendous_api.rb', line 2306

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



2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
# File 'lib/tremendous/api/tremendous_api.rb', line 2317

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'])

  # 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_public_keys(opts = {}) ⇒ PublicKeysResponse

List public keys Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys.

Parameters:

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

    the optional parameters

Returns:



2367
2368
2369
2370
# File 'lib/tremendous/api/tremendous_api.rb', line 2367

def list_public_keys(opts = {})
  data, _status_code, _headers = list_public_keys_with_http_info(opts)
  data
end

#list_public_keys_with_http_info(opts = {}) ⇒ Array<(PublicKeysResponse, Integer, Hash)>

List public keys Fetch a list of active public keys on your account. &gt; 🚧 Inactive public keys are omitted &gt; &gt; The response does not include inactive public keys.

Parameters:

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

    the optional parameters

Returns:

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

    PublicKeysResponse data, response status code and response headers



2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
# File 'lib/tremendous/api/tremendous_api.rb', line 2376

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

  # 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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"TremendousApi.list_public_keys",
    :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_public_keys\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:



2425
2426
2427
2428
# File 'lib/tremendous/api/tremendous_api.rb', line 2425

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



2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
# File 'lib/tremendous/api/tremendous_api.rb', line 2435

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'])

  # 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:



2484
2485
2486
2487
# File 'lib/tremendous/api/tremendous_api.rb', line 2484

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



2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
# File 'lib/tremendous/api/tremendous_api.rb', line 2493

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'])

  # 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:



2542
2543
2544
2545
# File 'lib/tremendous/api/tremendous_api.rb', line 2542

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:



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
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
# File 'lib/tremendous/api/tremendous_api.rb', line 2552

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'])

  # 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:



2609
2610
2611
2612
# File 'lib/tremendous/api/tremendous_api.rb', line 2609

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



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
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
# File 'lib/tremendous/api/tremendous_api.rb', line 2618

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'])

  # 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 = {}) ⇒ CreateOrder201Response

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:



2667
2668
2669
2670
# File 'lib/tremendous/api/tremendous_api.rb', line 2667

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<(CreateOrder201Response, 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<(CreateOrder201Response, Integer, Hash)>)

    CreateOrder201Response data, response status code and response headers



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
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
# File 'lib/tremendous/api/tremendous_api.rb', line 2677

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'])

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

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

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

  # 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

#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

Returns:

  • (Object)


2735
2736
2737
2738
# File 'lib/tremendous/api/tremendous_api.rb', line 2735

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

Returns:

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

    Object data, response status code and response headers



2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
# File 'lib/tremendous/api/tremendous_api.rb', line 2745

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'])

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

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

  # 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)


2804
2805
2806
2807
# File 'lib/tremendous/api/tremendous_api.rb', line 2804

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



2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
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
# File 'lib/tremendous/api/tremendous_api.rb', line 2815

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'])
  # 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

#test_public_key(id, test_public_key_request, opts = {}) ⇒ nil

Test public key Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as ‘{ "foo": "bar" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.

Parameters:

  • id (String)

    ID of the public key to test

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

    the optional parameters

Returns:

  • (nil)


2883
2884
2885
2886
# File 'lib/tremendous/api/tremendous_api.rb', line 2883

def test_public_key(id, test_public_key_request, opts = {})
  test_public_key_with_http_info(id, test_public_key_request, opts)
  nil
end

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

Test public key Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. &gt; 💡 Testing your integration &gt; &gt; **You can use [JWT.io](jwt.io/) to generate a signed token:** &gt; &gt; &gt; 1. Select “RS256” in their algorithm dropdown; &gt; 3. Define a JSON payload such as &#x60;{ &quot;foo&quot;: &quot;bar&quot; }&#x60;; &gt; 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.

Parameters:

  • id (String)

    ID of the public key to test

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
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
2951
2952
2953
2954
# File 'lib/tremendous/api/tremendous_api.rb', line 2894

def test_public_key_with_http_info(id, test_public_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.test_public_key ...'
  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.test_public_key"
  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.test_public_key, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'test_public_key_request' is set
  if @api_client.config.client_side_validation && test_public_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'test_public_key_request' when calling TremendousApi.test_public_key"
  end
  # resource path
  local_var_path = '/public_keys/{id}/decode_jwt'.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'])
  # 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(test_public_key_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"TremendousApi.test_public_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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#test_public_key\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:



2961
2962
2963
2964
# File 'lib/tremendous/api/tremendous_api.rb', line 2961

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



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
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
# File 'lib/tremendous/api/tremendous_api.rb', line 2971

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'])
  # 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