tremendous_ruby 5.9.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +522 -53
- data/lib/tremendous/models/connected_organization.rb +287 -0
- data/lib/tremendous/models/connected_organization_member.rb +330 -0
- data/lib/tremendous/models/connected_organization_member_member.rb +366 -0
- data/lib/tremendous/models/connected_organization_member_session.rb +311 -0
- data/lib/tremendous/models/connected_organization_organization.rb +324 -0
- data/lib/tremendous/models/create_campaign200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization_member200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization_member_request.rb +222 -0
- data/lib/tremendous/models/create_connected_organization_member_session200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +311 -0
- data/lib/tremendous/models/create_connected_organization_member_session_request.rb +222 -0
- data/lib/tremendous/models/create_connected_organization_request.rb +222 -0
- data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +1 -1
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +16 -4
- data/lib/tremendous/models/create_report200_response.rb +231 -0
- data/lib/tremendous/models/create_report200_response_report.rb +291 -0
- data/lib/tremendous/models/delivery_details.rb +1 -1
- data/lib/tremendous/models/delivery_details_with_link.rb +1 -1
- data/lib/tremendous/models/funding_source.rb +35 -1
- data/lib/tremendous/models/list_connected_organization_members200_response.rb +240 -0
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner.rb +330 -0
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +366 -0
- data/lib/tremendous/models/list_connected_organizations200_response.rb +240 -0
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner.rb +287 -0
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +324 -0
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +35 -1
- data/lib/tremendous/models/list_products_response_products_inner.rb +27 -7
- data/lib/tremendous/models/list_products_response_products_inner_documents.rb +236 -0
- data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +15 -4
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +1 -1
- data/lib/tremendous/models/product.rb +27 -7
- data/lib/tremendous/models/product_documents.rb +236 -0
- data/lib/tremendous/models/reward_with_link_delivery.rb +1 -1
- data/lib/tremendous/models/reward_without_link_delivery.rb +1 -1
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +23 -5
- metadata +26 -7
@@ -150,6 +150,74 @@ module Tremendous
|
|
150
150
|
return data, status_code, headers
|
151
151
|
end
|
152
152
|
|
153
|
+
# Cancel reward
|
154
|
+
# Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled.
|
155
|
+
# @param id [String] ID of the reward that should be canceled
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @return [Object]
|
158
|
+
def cancel_reward(id, opts = {})
|
159
|
+
data, _status_code, _headers = cancel_reward_with_http_info(id, opts)
|
160
|
+
data
|
161
|
+
end
|
162
|
+
|
163
|
+
# Cancel reward
|
164
|
+
# Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled.
|
165
|
+
# @param id [String] ID of the reward that should be canceled
|
166
|
+
# @param [Hash] opts the optional parameters
|
167
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
168
|
+
def cancel_reward_with_http_info(id, opts = {})
|
169
|
+
if @api_client.config.debugging
|
170
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.cancel_reward ...'
|
171
|
+
end
|
172
|
+
# verify the required parameter 'id' is set
|
173
|
+
if @api_client.config.client_side_validation && id.nil?
|
174
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.cancel_reward"
|
175
|
+
end
|
176
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
177
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
178
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.cancel_reward, must conform to the pattern #{pattern}."
|
179
|
+
end
|
180
|
+
|
181
|
+
# resource path
|
182
|
+
local_var_path = '/rewards/{id}/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
183
|
+
|
184
|
+
# query parameters
|
185
|
+
query_params = opts[:query_params] || {}
|
186
|
+
|
187
|
+
# header parameters
|
188
|
+
header_params = opts[:header_params] || {}
|
189
|
+
# HTTP header 'Accept' (if needed)
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
191
|
+
|
192
|
+
# form parameters
|
193
|
+
form_params = opts[:form_params] || {}
|
194
|
+
|
195
|
+
# http body (model)
|
196
|
+
post_body = opts[:debug_body]
|
197
|
+
|
198
|
+
# return_type
|
199
|
+
return_type = opts[:debug_return_type] || 'Object'
|
200
|
+
|
201
|
+
# auth_names
|
202
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
203
|
+
|
204
|
+
new_options = opts.merge(
|
205
|
+
:operation => :"TremendousApi.cancel_reward",
|
206
|
+
:header_params => header_params,
|
207
|
+
:query_params => query_params,
|
208
|
+
:form_params => form_params,
|
209
|
+
:body => post_body,
|
210
|
+
:auth_names => auth_names,
|
211
|
+
:return_type => return_type
|
212
|
+
)
|
213
|
+
|
214
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
215
|
+
if @api_client.config.debugging
|
216
|
+
@api_client.config.logger.debug "API called: TremendousApi#cancel_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
217
|
+
end
|
218
|
+
return data, status_code, headers
|
219
|
+
end
|
220
|
+
|
153
221
|
# Create API key
|
154
222
|
# Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
155
223
|
# @param [Hash] opts the optional parameters
|
@@ -210,7 +278,7 @@ module Tremendous
|
|
210
278
|
# Create campaign
|
211
279
|
# @param create_campaign_request [CreateCampaignRequest] Campaign details
|
212
280
|
# @param [Hash] opts the optional parameters
|
213
|
-
# @return [
|
281
|
+
# @return [CreateCampaign200Response]
|
214
282
|
def create_campaign(create_campaign_request, opts = {})
|
215
283
|
data, _status_code, _headers = create_campaign_with_http_info(create_campaign_request, opts)
|
216
284
|
data
|
@@ -219,7 +287,7 @@ module Tremendous
|
|
219
287
|
# Create campaign
|
220
288
|
# @param create_campaign_request [CreateCampaignRequest] Campaign details
|
221
289
|
# @param [Hash] opts the optional parameters
|
222
|
-
# @return [Array<(
|
290
|
+
# @return [Array<(CreateCampaign200Response, Integer, Hash)>] CreateCampaign200Response data, response status code and response headers
|
223
291
|
def create_campaign_with_http_info(create_campaign_request, opts = {})
|
224
292
|
if @api_client.config.debugging
|
225
293
|
@api_client.config.logger.debug 'Calling API: TremendousApi.create_campaign ...'
|
@@ -251,7 +319,7 @@ module Tremendous
|
|
251
319
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)
|
252
320
|
|
253
321
|
# return_type
|
254
|
-
return_type = opts[:debug_return_type] || '
|
322
|
+
return_type = opts[:debug_return_type] || 'CreateCampaign200Response'
|
255
323
|
|
256
324
|
# auth_names
|
257
325
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
@@ -273,6 +341,216 @@ module Tremendous
|
|
273
341
|
return data, status_code, headers
|
274
342
|
end
|
275
343
|
|
344
|
+
# Create connected organization
|
345
|
+
# Create a connected organization.
|
346
|
+
# @param create_connected_organization_request [CreateConnectedOrganizationRequest] Connected organization to create
|
347
|
+
# @param [Hash] opts the optional parameters
|
348
|
+
# @return [CreateConnectedOrganization200Response]
|
349
|
+
def create_connected_organization(create_connected_organization_request, opts = {})
|
350
|
+
data, _status_code, _headers = create_connected_organization_with_http_info(create_connected_organization_request, opts)
|
351
|
+
data
|
352
|
+
end
|
353
|
+
|
354
|
+
# Create connected organization
|
355
|
+
# Create a connected organization.
|
356
|
+
# @param create_connected_organization_request [CreateConnectedOrganizationRequest] Connected organization to create
|
357
|
+
# @param [Hash] opts the optional parameters
|
358
|
+
# @return [Array<(CreateConnectedOrganization200Response, Integer, Hash)>] CreateConnectedOrganization200Response data, response status code and response headers
|
359
|
+
def create_connected_organization_with_http_info(create_connected_organization_request, opts = {})
|
360
|
+
if @api_client.config.debugging
|
361
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.create_connected_organization ...'
|
362
|
+
end
|
363
|
+
# verify the required parameter 'create_connected_organization_request' is set
|
364
|
+
if @api_client.config.client_side_validation && create_connected_organization_request.nil?
|
365
|
+
fail ArgumentError, "Missing the required parameter 'create_connected_organization_request' when calling TremendousApi.create_connected_organization"
|
366
|
+
end
|
367
|
+
# resource path
|
368
|
+
local_var_path = '/connected_organizations'
|
369
|
+
|
370
|
+
# query parameters
|
371
|
+
query_params = opts[:query_params] || {}
|
372
|
+
|
373
|
+
# header parameters
|
374
|
+
header_params = opts[:header_params] || {}
|
375
|
+
# HTTP header 'Accept' (if needed)
|
376
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
377
|
+
# HTTP header 'Content-Type'
|
378
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
379
|
+
if !content_type.nil?
|
380
|
+
header_params['Content-Type'] = content_type
|
381
|
+
end
|
382
|
+
|
383
|
+
# form parameters
|
384
|
+
form_params = opts[:form_params] || {}
|
385
|
+
|
386
|
+
# http body (model)
|
387
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connected_organization_request)
|
388
|
+
|
389
|
+
# return_type
|
390
|
+
return_type = opts[:debug_return_type] || 'CreateConnectedOrganization200Response'
|
391
|
+
|
392
|
+
# auth_names
|
393
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
394
|
+
|
395
|
+
new_options = opts.merge(
|
396
|
+
:operation => :"TremendousApi.create_connected_organization",
|
397
|
+
:header_params => header_params,
|
398
|
+
:query_params => query_params,
|
399
|
+
:form_params => form_params,
|
400
|
+
:body => post_body,
|
401
|
+
:auth_names => auth_names,
|
402
|
+
:return_type => return_type
|
403
|
+
)
|
404
|
+
|
405
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
406
|
+
if @api_client.config.debugging
|
407
|
+
@api_client.config.logger.debug "API called: TremendousApi#create_connected_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
408
|
+
end
|
409
|
+
return data, status_code, headers
|
410
|
+
end
|
411
|
+
|
412
|
+
# Create connected organization member
|
413
|
+
# Create a connected organization member.
|
414
|
+
# @param create_connected_organization_member_request [CreateConnectedOrganizationMemberRequest] Connected organization member to create
|
415
|
+
# @param [Hash] opts the optional parameters
|
416
|
+
# @return [CreateConnectedOrganizationMember200Response]
|
417
|
+
def create_connected_organization_member(create_connected_organization_member_request, opts = {})
|
418
|
+
data, _status_code, _headers = create_connected_organization_member_with_http_info(create_connected_organization_member_request, opts)
|
419
|
+
data
|
420
|
+
end
|
421
|
+
|
422
|
+
# Create connected organization member
|
423
|
+
# Create a connected organization member.
|
424
|
+
# @param create_connected_organization_member_request [CreateConnectedOrganizationMemberRequest] Connected organization member to create
|
425
|
+
# @param [Hash] opts the optional parameters
|
426
|
+
# @return [Array<(CreateConnectedOrganizationMember200Response, Integer, Hash)>] CreateConnectedOrganizationMember200Response data, response status code and response headers
|
427
|
+
def create_connected_organization_member_with_http_info(create_connected_organization_member_request, opts = {})
|
428
|
+
if @api_client.config.debugging
|
429
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.create_connected_organization_member ...'
|
430
|
+
end
|
431
|
+
# verify the required parameter 'create_connected_organization_member_request' is set
|
432
|
+
if @api_client.config.client_side_validation && create_connected_organization_member_request.nil?
|
433
|
+
fail ArgumentError, "Missing the required parameter 'create_connected_organization_member_request' when calling TremendousApi.create_connected_organization_member"
|
434
|
+
end
|
435
|
+
# resource path
|
436
|
+
local_var_path = '/connected_organization_members'
|
437
|
+
|
438
|
+
# query parameters
|
439
|
+
query_params = opts[:query_params] || {}
|
440
|
+
|
441
|
+
# header parameters
|
442
|
+
header_params = opts[:header_params] || {}
|
443
|
+
# HTTP header 'Accept' (if needed)
|
444
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
445
|
+
# HTTP header 'Content-Type'
|
446
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
447
|
+
if !content_type.nil?
|
448
|
+
header_params['Content-Type'] = content_type
|
449
|
+
end
|
450
|
+
|
451
|
+
# form parameters
|
452
|
+
form_params = opts[:form_params] || {}
|
453
|
+
|
454
|
+
# http body (model)
|
455
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connected_organization_member_request)
|
456
|
+
|
457
|
+
# return_type
|
458
|
+
return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMember200Response'
|
459
|
+
|
460
|
+
# auth_names
|
461
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
462
|
+
|
463
|
+
new_options = opts.merge(
|
464
|
+
:operation => :"TremendousApi.create_connected_organization_member",
|
465
|
+
:header_params => header_params,
|
466
|
+
:query_params => query_params,
|
467
|
+
:form_params => form_params,
|
468
|
+
:body => post_body,
|
469
|
+
:auth_names => auth_names,
|
470
|
+
:return_type => return_type
|
471
|
+
)
|
472
|
+
|
473
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
474
|
+
if @api_client.config.debugging
|
475
|
+
@api_client.config.logger.debug "API called: TremendousApi#create_connected_organization_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
476
|
+
end
|
477
|
+
return data, status_code, headers
|
478
|
+
end
|
479
|
+
|
480
|
+
# Create connected organization member session
|
481
|
+
# Create a connected organization member session.
|
482
|
+
# @param id [String] ID of the connected organization member.
|
483
|
+
# @param create_connected_organization_member_session_request [CreateConnectedOrganizationMemberSessionRequest] Connected organization member requiring the session
|
484
|
+
# @param [Hash] opts the optional parameters
|
485
|
+
# @return [CreateConnectedOrganizationMemberSession200Response]
|
486
|
+
def create_connected_organization_member_session(id, create_connected_organization_member_session_request, opts = {})
|
487
|
+
data, _status_code, _headers = create_connected_organization_member_session_with_http_info(id, create_connected_organization_member_session_request, opts)
|
488
|
+
data
|
489
|
+
end
|
490
|
+
|
491
|
+
# Create connected organization member session
|
492
|
+
# Create a connected organization member session.
|
493
|
+
# @param id [String] ID of the connected organization member.
|
494
|
+
# @param create_connected_organization_member_session_request [CreateConnectedOrganizationMemberSessionRequest] Connected organization member requiring the session
|
495
|
+
# @param [Hash] opts the optional parameters
|
496
|
+
# @return [Array<(CreateConnectedOrganizationMemberSession200Response, Integer, Hash)>] CreateConnectedOrganizationMemberSession200Response data, response status code and response headers
|
497
|
+
def create_connected_organization_member_session_with_http_info(id, create_connected_organization_member_session_request, opts = {})
|
498
|
+
if @api_client.config.debugging
|
499
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.create_connected_organization_member_session ...'
|
500
|
+
end
|
501
|
+
# verify the required parameter 'id' is set
|
502
|
+
if @api_client.config.client_side_validation && id.nil?
|
503
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.create_connected_organization_member_session"
|
504
|
+
end
|
505
|
+
# verify the required parameter 'create_connected_organization_member_session_request' is set
|
506
|
+
if @api_client.config.client_side_validation && create_connected_organization_member_session_request.nil?
|
507
|
+
fail ArgumentError, "Missing the required parameter 'create_connected_organization_member_session_request' when calling TremendousApi.create_connected_organization_member_session"
|
508
|
+
end
|
509
|
+
# resource path
|
510
|
+
local_var_path = '/connected_organization_members/{id}/sessions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
511
|
+
|
512
|
+
# query parameters
|
513
|
+
query_params = opts[:query_params] || {}
|
514
|
+
|
515
|
+
# header parameters
|
516
|
+
header_params = opts[:header_params] || {}
|
517
|
+
# HTTP header 'Accept' (if needed)
|
518
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
519
|
+
# HTTP header 'Content-Type'
|
520
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
521
|
+
if !content_type.nil?
|
522
|
+
header_params['Content-Type'] = content_type
|
523
|
+
end
|
524
|
+
|
525
|
+
# form parameters
|
526
|
+
form_params = opts[:form_params] || {}
|
527
|
+
|
528
|
+
# http body (model)
|
529
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connected_organization_member_session_request)
|
530
|
+
|
531
|
+
# return_type
|
532
|
+
return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMemberSession200Response'
|
533
|
+
|
534
|
+
# auth_names
|
535
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
536
|
+
|
537
|
+
new_options = opts.merge(
|
538
|
+
:operation => :"TremendousApi.create_connected_organization_member_session",
|
539
|
+
:header_params => header_params,
|
540
|
+
:query_params => query_params,
|
541
|
+
:form_params => form_params,
|
542
|
+
:body => post_body,
|
543
|
+
:auth_names => auth_names,
|
544
|
+
:return_type => return_type
|
545
|
+
)
|
546
|
+
|
547
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
548
|
+
if @api_client.config.debugging
|
549
|
+
@api_client.config.logger.debug "API called: TremendousApi#create_connected_organization_member_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
550
|
+
end
|
551
|
+
return data, status_code, headers
|
552
|
+
end
|
553
|
+
|
276
554
|
# Create invoice
|
277
555
|
# 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>
|
278
556
|
# @param create_invoice_request [CreateInvoiceRequest] Invoice details
|
@@ -410,7 +688,7 @@ module Tremendous
|
|
410
688
|
end
|
411
689
|
|
412
690
|
# Create order
|
413
|
-
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
691
|
+
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
414
692
|
# @param create_order_request [CreateOrderRequest] Order to create
|
415
693
|
# @param [Hash] opts the optional parameters
|
416
694
|
# @return [CreateOrder200Response]
|
@@ -420,7 +698,7 @@ module Tremendous
|
|
420
698
|
end
|
421
699
|
|
422
700
|
# Create order
|
423
|
-
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
|
701
|
+
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
424
702
|
# @param create_order_request [CreateOrderRequest] Order to create
|
425
703
|
# @param [Hash] opts the optional parameters
|
426
704
|
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
@@ -549,7 +827,7 @@ module Tremendous
|
|
549
827
|
# Creating a report allows your organization to programmatically retrieve information that's available in our dashboard UI. This request creates a new report object with a unique ID, and kicks off an async report generation. To retrieve a completed report, either poll `/api/v2/reports/{id}` or listen for REPORTS webhook event. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">report_type</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Type of report for retrieval. <table> <thead> <tr> <th>Report type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>digital_rewards</code></td> <td>Report for Tremendous digital reward history</td> </tr> </tbody> </table></p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">format</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Format the report will be generated in. <table> <thead> <tr> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>csv</code></td> <td>CSV format for report</td> </tr> </tbody> </table></p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">filters</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Filters to apply to the report. Corresponds to the filters provided in the dashboard</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">digital_rewards</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Filters object for a <code>report_type: digital_rewards</code> report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Amount of the rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Minimum amount of the rewards that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Maximum amount of the rewards that should be returned in the report</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous campaign that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Creation dates of rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Minimum date the reward was created</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Maximum date the reward was created</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivered_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Delivery date for gifts that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery_method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Delivery method for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous order that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_status</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Order status for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">status</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>Status for rewards returned in the report</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ## Rate limits Some reports may take a long time to generate and we limit the number of reports that can be simultaneously generated by an organization at a given time. If you exceed the rate limit, you'll receive a `429` response.
|
550
828
|
# @param create_report_request [CreateReportRequest] Report to create
|
551
829
|
# @param [Hash] opts the optional parameters
|
552
|
-
# @return [
|
830
|
+
# @return [CreateReport200Response]
|
553
831
|
def create_report(create_report_request, opts = {})
|
554
832
|
data, _status_code, _headers = create_report_with_http_info(create_report_request, opts)
|
555
833
|
data
|
@@ -559,7 +837,7 @@ module Tremendous
|
|
559
837
|
# Creating a report allows your organization to programmatically retrieve information that's available in our dashboard UI. This request creates a new report object with a unique ID, and kicks off an async report generation. To retrieve a completed report, either poll `/api/v2/reports/{id}` or listen for REPORTS webhook event. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">report_type</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Type of report for retrieval. <table> <thead> <tr> <th>Report type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>digital_rewards</code></td> <td>Report for Tremendous digital reward history</td> </tr> </tbody> </table></p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">format</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Format the report will be generated in. <table> <thead> <tr> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>csv</code></td> <td>CSV format for report</td> </tr> </tbody> </table></p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">filters</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Filters to apply to the report. Corresponds to the filters provided in the dashboard</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">digital_rewards</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Filters object for a <code>report_type: digital_rewards</code> report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Amount of the rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Minimum amount of the rewards that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Maximum amount of the rewards that should be returned in the report</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous campaign that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Creation dates of rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Minimum date the reward was created</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Maximum date the reward was created</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivered_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Delivery date for gifts that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery_method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Delivery method for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous order that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_status</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Order status for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">status</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>Status for rewards returned in the report</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ## Rate limits Some reports may take a long time to generate and we limit the number of reports that can be simultaneously generated by an organization at a given time. If you exceed the rate limit, you'll receive a `429` response.
|
560
838
|
# @param create_report_request [CreateReportRequest] Report to create
|
561
839
|
# @param [Hash] opts the optional parameters
|
562
|
-
# @return [Array<(
|
840
|
+
# @return [Array<(CreateReport200Response, Integer, Hash)>] CreateReport200Response data, response status code and response headers
|
563
841
|
def create_report_with_http_info(create_report_request, opts = {})
|
564
842
|
if @api_client.config.debugging
|
565
843
|
@api_client.config.logger.debug 'Calling API: TremendousApi.create_report ...'
|
@@ -591,7 +869,7 @@ module Tremendous
|
|
591
869
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_report_request)
|
592
870
|
|
593
871
|
# return_type
|
594
|
-
return_type = opts[:debug_return_type] || '
|
872
|
+
return_type = opts[:debug_return_type] || 'CreateReport200Response'
|
595
873
|
|
596
874
|
# auth_names
|
597
875
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
@@ -1149,36 +1427,36 @@ module Tremendous
|
|
1149
1427
|
return data, status_code, headers
|
1150
1428
|
end
|
1151
1429
|
|
1152
|
-
#
|
1153
|
-
#
|
1154
|
-
# @param id [String] ID of the
|
1430
|
+
# Retrieve campaign
|
1431
|
+
# Retrieve a campaign, identified by the given `id` in the URL
|
1432
|
+
# @param id [String] ID of the campaign that should be retrieved
|
1155
1433
|
# @param [Hash] opts the optional parameters
|
1156
|
-
# @return [
|
1157
|
-
def
|
1158
|
-
data, _status_code, _headers =
|
1434
|
+
# @return [CreateCampaign200Response]
|
1435
|
+
def get_campaign(id, opts = {})
|
1436
|
+
data, _status_code, _headers = get_campaign_with_http_info(id, opts)
|
1159
1437
|
data
|
1160
1438
|
end
|
1161
1439
|
|
1162
|
-
#
|
1163
|
-
#
|
1164
|
-
# @param id [String] ID of the
|
1440
|
+
# Retrieve campaign
|
1441
|
+
# Retrieve a campaign, identified by the given `id` in the URL
|
1442
|
+
# @param id [String] ID of the campaign that should be retrieved
|
1165
1443
|
# @param [Hash] opts the optional parameters
|
1166
|
-
# @return [Array<(
|
1167
|
-
def
|
1444
|
+
# @return [Array<(CreateCampaign200Response, Integer, Hash)>] CreateCampaign200Response data, response status code and response headers
|
1445
|
+
def get_campaign_with_http_info(id, opts = {})
|
1168
1446
|
if @api_client.config.debugging
|
1169
|
-
@api_client.config.logger.debug 'Calling API: TremendousApi.
|
1447
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...'
|
1170
1448
|
end
|
1171
1449
|
# verify the required parameter 'id' is set
|
1172
1450
|
if @api_client.config.client_side_validation && id.nil?
|
1173
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.
|
1451
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_campaign"
|
1174
1452
|
end
|
1175
1453
|
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
1176
1454
|
if @api_client.config.client_side_validation && id !~ pattern
|
1177
|
-
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.
|
1455
|
+
fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_campaign, must conform to the pattern #{pattern}."
|
1178
1456
|
end
|
1179
1457
|
|
1180
1458
|
# resource path
|
1181
|
-
local_var_path = '/
|
1459
|
+
local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1182
1460
|
|
1183
1461
|
# query parameters
|
1184
1462
|
query_params = opts[:query_params] || {}
|
@@ -1195,13 +1473,13 @@ module Tremendous
|
|
1195
1473
|
post_body = opts[:debug_body]
|
1196
1474
|
|
1197
1475
|
# return_type
|
1198
|
-
return_type = opts[:debug_return_type] || '
|
1476
|
+
return_type = opts[:debug_return_type] || 'CreateCampaign200Response'
|
1199
1477
|
|
1200
1478
|
# auth_names
|
1201
1479
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
1202
1480
|
|
1203
1481
|
new_options = opts.merge(
|
1204
|
-
:operation => :"TremendousApi.
|
1482
|
+
:operation => :"TremendousApi.get_campaign",
|
1205
1483
|
:header_params => header_params,
|
1206
1484
|
:query_params => query_params,
|
1207
1485
|
:form_params => form_params,
|
@@ -1210,43 +1488,101 @@ module Tremendous
|
|
1210
1488
|
:return_type => return_type
|
1211
1489
|
)
|
1212
1490
|
|
1213
|
-
data, status_code, headers = @api_client.call_api(:
|
1491
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1214
1492
|
if @api_client.config.debugging
|
1215
|
-
@api_client.config.logger.debug "API called: TremendousApi#
|
1493
|
+
@api_client.config.logger.debug "API called: TremendousApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1216
1494
|
end
|
1217
1495
|
return data, status_code, headers
|
1218
1496
|
end
|
1219
1497
|
|
1220
|
-
# Retrieve
|
1221
|
-
# Retrieve
|
1222
|
-
# @param id [String] ID of the
|
1498
|
+
# Retrieve a connected organization
|
1499
|
+
# Retrieve the connected organization, identified by the given `id` in the URL
|
1500
|
+
# @param id [String] ID of the connected organization that should be retrieved.
|
1223
1501
|
# @param [Hash] opts the optional parameters
|
1224
|
-
# @return [
|
1225
|
-
def
|
1226
|
-
data, _status_code, _headers =
|
1502
|
+
# @return [CreateConnectedOrganization200Response]
|
1503
|
+
def get_connected_organization(id, opts = {})
|
1504
|
+
data, _status_code, _headers = get_connected_organization_with_http_info(id, opts)
|
1227
1505
|
data
|
1228
1506
|
end
|
1229
1507
|
|
1230
|
-
# Retrieve
|
1231
|
-
# Retrieve
|
1232
|
-
# @param id [String] ID of the
|
1508
|
+
# Retrieve a connected organization
|
1509
|
+
# Retrieve the connected organization, identified by the given `id` in the URL
|
1510
|
+
# @param id [String] ID of the connected organization that should be retrieved.
|
1233
1511
|
# @param [Hash] opts the optional parameters
|
1234
|
-
# @return [Array<(
|
1235
|
-
def
|
1512
|
+
# @return [Array<(CreateConnectedOrganization200Response, Integer, Hash)>] CreateConnectedOrganization200Response data, response status code and response headers
|
1513
|
+
def get_connected_organization_with_http_info(id, opts = {})
|
1236
1514
|
if @api_client.config.debugging
|
1237
|
-
@api_client.config.logger.debug 'Calling API: TremendousApi.
|
1515
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.get_connected_organization ...'
|
1238
1516
|
end
|
1239
1517
|
# verify the required parameter 'id' is set
|
1240
1518
|
if @api_client.config.client_side_validation && id.nil?
|
1241
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.
|
1519
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_connected_organization"
|
1242
1520
|
end
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1521
|
+
# resource path
|
1522
|
+
local_var_path = '/connected_organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1523
|
+
|
1524
|
+
# query parameters
|
1525
|
+
query_params = opts[:query_params] || {}
|
1526
|
+
|
1527
|
+
# header parameters
|
1528
|
+
header_params = opts[:header_params] || {}
|
1529
|
+
# HTTP header 'Accept' (if needed)
|
1530
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
1531
|
+
|
1532
|
+
# form parameters
|
1533
|
+
form_params = opts[:form_params] || {}
|
1534
|
+
|
1535
|
+
# http body (model)
|
1536
|
+
post_body = opts[:debug_body]
|
1537
|
+
|
1538
|
+
# return_type
|
1539
|
+
return_type = opts[:debug_return_type] || 'CreateConnectedOrganization200Response'
|
1540
|
+
|
1541
|
+
# auth_names
|
1542
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
1543
|
+
|
1544
|
+
new_options = opts.merge(
|
1545
|
+
:operation => :"TremendousApi.get_connected_organization",
|
1546
|
+
:header_params => header_params,
|
1547
|
+
:query_params => query_params,
|
1548
|
+
:form_params => form_params,
|
1549
|
+
:body => post_body,
|
1550
|
+
:auth_names => auth_names,
|
1551
|
+
:return_type => return_type
|
1552
|
+
)
|
1553
|
+
|
1554
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1555
|
+
if @api_client.config.debugging
|
1556
|
+
@api_client.config.logger.debug "API called: TremendousApi#get_connected_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1246
1557
|
end
|
1558
|
+
return data, status_code, headers
|
1559
|
+
end
|
1247
1560
|
|
1561
|
+
# Retrieve a connected organization member
|
1562
|
+
# Retrieve the connected organization member, identified by the given `id` in the URL
|
1563
|
+
# @param id [String] ID of the connected organization member that should be retrieved.
|
1564
|
+
# @param [Hash] opts the optional parameters
|
1565
|
+
# @return [CreateConnectedOrganizationMember200Response]
|
1566
|
+
def get_connected_organization_member(id, opts = {})
|
1567
|
+
data, _status_code, _headers = get_connected_organization_member_with_http_info(id, opts)
|
1568
|
+
data
|
1569
|
+
end
|
1570
|
+
|
1571
|
+
# Retrieve a connected organization member
|
1572
|
+
# Retrieve the connected organization member, identified by the given `id` in the URL
|
1573
|
+
# @param id [String] ID of the connected organization member that should be retrieved.
|
1574
|
+
# @param [Hash] opts the optional parameters
|
1575
|
+
# @return [Array<(CreateConnectedOrganizationMember200Response, Integer, Hash)>] CreateConnectedOrganizationMember200Response data, response status code and response headers
|
1576
|
+
def get_connected_organization_member_with_http_info(id, opts = {})
|
1577
|
+
if @api_client.config.debugging
|
1578
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.get_connected_organization_member ...'
|
1579
|
+
end
|
1580
|
+
# verify the required parameter 'id' is set
|
1581
|
+
if @api_client.config.client_side_validation && id.nil?
|
1582
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_connected_organization_member"
|
1583
|
+
end
|
1248
1584
|
# resource path
|
1249
|
-
local_var_path = '/
|
1585
|
+
local_var_path = '/connected_organization_members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1250
1586
|
|
1251
1587
|
# query parameters
|
1252
1588
|
query_params = opts[:query_params] || {}
|
@@ -1263,13 +1599,13 @@ module Tremendous
|
|
1263
1599
|
post_body = opts[:debug_body]
|
1264
1600
|
|
1265
1601
|
# return_type
|
1266
|
-
return_type = opts[:debug_return_type] || '
|
1602
|
+
return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMember200Response'
|
1267
1603
|
|
1268
1604
|
# auth_names
|
1269
1605
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
1270
1606
|
|
1271
1607
|
new_options = opts.merge(
|
1272
|
-
:operation => :"TremendousApi.
|
1608
|
+
:operation => :"TremendousApi.get_connected_organization_member",
|
1273
1609
|
:header_params => header_params,
|
1274
1610
|
:query_params => query_params,
|
1275
1611
|
:form_params => form_params,
|
@@ -1280,7 +1616,7 @@ module Tremendous
|
|
1280
1616
|
|
1281
1617
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1282
1618
|
if @api_client.config.debugging
|
1283
|
-
@api_client.config.logger.debug "API called: TremendousApi#
|
1619
|
+
@api_client.config.logger.debug "API called: TremendousApi#get_connected_organization_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1284
1620
|
end
|
1285
1621
|
return data, status_code, headers
|
1286
1622
|
end
|
@@ -1746,7 +2082,7 @@ module Tremendous
|
|
1746
2082
|
# Retrieve the report, identified by the given `id` in the URL Using the ID that was returned by `POST /api/v2/reports`, retrieves a download link for the report, identified by the given ID in the URL. Returns the report’s current status and, if available, the URL for download. The URL is valid for 7 days.
|
1747
2083
|
# @param id [String] ID of the report that should be retrieved. ID is returned from `POST` to /api/v2/reports
|
1748
2084
|
# @param [Hash] opts the optional parameters
|
1749
|
-
# @return [
|
2085
|
+
# @return [CreateReport200Response]
|
1750
2086
|
def get_report(id, opts = {})
|
1751
2087
|
data, _status_code, _headers = get_report_with_http_info(id, opts)
|
1752
2088
|
data
|
@@ -1756,7 +2092,7 @@ module Tremendous
|
|
1756
2092
|
# Retrieve the report, identified by the given `id` in the URL Using the ID that was returned by `POST /api/v2/reports`, retrieves a download link for the report, identified by the given ID in the URL. Returns the report’s current status and, if available, the URL for download. The URL is valid for 7 days.
|
1757
2093
|
# @param id [String] ID of the report that should be retrieved. ID is returned from `POST` to /api/v2/reports
|
1758
2094
|
# @param [Hash] opts the optional parameters
|
1759
|
-
# @return [Array<(
|
2095
|
+
# @return [Array<(CreateReport200Response, Integer, Hash)>] CreateReport200Response data, response status code and response headers
|
1760
2096
|
def get_report_with_http_info(id, opts = {})
|
1761
2097
|
if @api_client.config.debugging
|
1762
2098
|
@api_client.config.logger.debug 'Calling API: TremendousApi.get_report ...'
|
@@ -1783,7 +2119,7 @@ module Tremendous
|
|
1783
2119
|
post_body = opts[:debug_body]
|
1784
2120
|
|
1785
2121
|
# return_type
|
1786
|
-
return_type = opts[:debug_return_type] || '
|
2122
|
+
return_type = opts[:debug_return_type] || 'CreateReport200Response'
|
1787
2123
|
|
1788
2124
|
# auth_names
|
1789
2125
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
@@ -2067,6 +2403,139 @@ module Tremendous
|
|
2067
2403
|
return data, status_code, headers
|
2068
2404
|
end
|
2069
2405
|
|
2406
|
+
# List connected organization members
|
2407
|
+
# Retrieve a list of connected organization members.
|
2408
|
+
# @param connected_organization_id [String] ID of the connected organization.
|
2409
|
+
# @param [Hash] opts the optional parameters
|
2410
|
+
# @option opts [Integer] :offset Offsets the returned list by the given number of connected organizations.
|
2411
|
+
# @option opts [Integer] :limit Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.
|
2412
|
+
# @return [ListConnectedOrganizationMembers200Response]
|
2413
|
+
def list_connected_organization_members(connected_organization_id, opts = {})
|
2414
|
+
data, _status_code, _headers = list_connected_organization_members_with_http_info(connected_organization_id, opts)
|
2415
|
+
data
|
2416
|
+
end
|
2417
|
+
|
2418
|
+
# List connected organization members
|
2419
|
+
# Retrieve a list of connected organization members.
|
2420
|
+
# @param connected_organization_id [String] ID of the connected organization.
|
2421
|
+
# @param [Hash] opts the optional parameters
|
2422
|
+
# @option opts [Integer] :offset Offsets the returned list by the given number of connected organizations.
|
2423
|
+
# @option opts [Integer] :limit Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.
|
2424
|
+
# @return [Array<(ListConnectedOrganizationMembers200Response, Integer, Hash)>] ListConnectedOrganizationMembers200Response data, response status code and response headers
|
2425
|
+
def list_connected_organization_members_with_http_info(connected_organization_id, opts = {})
|
2426
|
+
if @api_client.config.debugging
|
2427
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_connected_organization_members ...'
|
2428
|
+
end
|
2429
|
+
# verify the required parameter 'connected_organization_id' is set
|
2430
|
+
if @api_client.config.client_side_validation && connected_organization_id.nil?
|
2431
|
+
fail ArgumentError, "Missing the required parameter 'connected_organization_id' when calling TremendousApi.list_connected_organization_members"
|
2432
|
+
end
|
2433
|
+
# resource path
|
2434
|
+
local_var_path = '/connected_organization_members'
|
2435
|
+
|
2436
|
+
# query parameters
|
2437
|
+
query_params = opts[:query_params] || {}
|
2438
|
+
query_params[:'connected_organization_id'] = connected_organization_id
|
2439
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
2440
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
2441
|
+
|
2442
|
+
# header parameters
|
2443
|
+
header_params = opts[:header_params] || {}
|
2444
|
+
# HTTP header 'Accept' (if needed)
|
2445
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
2446
|
+
|
2447
|
+
# form parameters
|
2448
|
+
form_params = opts[:form_params] || {}
|
2449
|
+
|
2450
|
+
# http body (model)
|
2451
|
+
post_body = opts[:debug_body]
|
2452
|
+
|
2453
|
+
# return_type
|
2454
|
+
return_type = opts[:debug_return_type] || 'ListConnectedOrganizationMembers200Response'
|
2455
|
+
|
2456
|
+
# auth_names
|
2457
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
2458
|
+
|
2459
|
+
new_options = opts.merge(
|
2460
|
+
:operation => :"TremendousApi.list_connected_organization_members",
|
2461
|
+
:header_params => header_params,
|
2462
|
+
:query_params => query_params,
|
2463
|
+
:form_params => form_params,
|
2464
|
+
:body => post_body,
|
2465
|
+
:auth_names => auth_names,
|
2466
|
+
:return_type => return_type
|
2467
|
+
)
|
2468
|
+
|
2469
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2470
|
+
if @api_client.config.debugging
|
2471
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_connected_organization_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2472
|
+
end
|
2473
|
+
return data, status_code, headers
|
2474
|
+
end
|
2475
|
+
|
2476
|
+
# List connected organizations
|
2477
|
+
# Retrieve a list of connected organizations.
|
2478
|
+
# @param [Hash] opts the optional parameters
|
2479
|
+
# @option opts [Integer] :offset Offsets the returned list by the given number of connected organizations.
|
2480
|
+
# @option opts [Integer] :limit Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.
|
2481
|
+
# @return [ListConnectedOrganizations200Response]
|
2482
|
+
def list_connected_organizations(opts = {})
|
2483
|
+
data, _status_code, _headers = list_connected_organizations_with_http_info(opts)
|
2484
|
+
data
|
2485
|
+
end
|
2486
|
+
|
2487
|
+
# List connected organizations
|
2488
|
+
# Retrieve a list of connected organizations.
|
2489
|
+
# @param [Hash] opts the optional parameters
|
2490
|
+
# @option opts [Integer] :offset Offsets the returned list by the given number of connected organizations.
|
2491
|
+
# @option opts [Integer] :limit Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.
|
2492
|
+
# @return [Array<(ListConnectedOrganizations200Response, Integer, Hash)>] ListConnectedOrganizations200Response data, response status code and response headers
|
2493
|
+
def list_connected_organizations_with_http_info(opts = {})
|
2494
|
+
if @api_client.config.debugging
|
2495
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_connected_organizations ...'
|
2496
|
+
end
|
2497
|
+
# resource path
|
2498
|
+
local_var_path = '/connected_organizations'
|
2499
|
+
|
2500
|
+
# query parameters
|
2501
|
+
query_params = opts[:query_params] || {}
|
2502
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
2503
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
2504
|
+
|
2505
|
+
# header parameters
|
2506
|
+
header_params = opts[:header_params] || {}
|
2507
|
+
# HTTP header 'Accept' (if needed)
|
2508
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
2509
|
+
|
2510
|
+
# form parameters
|
2511
|
+
form_params = opts[:form_params] || {}
|
2512
|
+
|
2513
|
+
# http body (model)
|
2514
|
+
post_body = opts[:debug_body]
|
2515
|
+
|
2516
|
+
# return_type
|
2517
|
+
return_type = opts[:debug_return_type] || 'ListConnectedOrganizations200Response'
|
2518
|
+
|
2519
|
+
# auth_names
|
2520
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
2521
|
+
|
2522
|
+
new_options = opts.merge(
|
2523
|
+
:operation => :"TremendousApi.list_connected_organizations",
|
2524
|
+
:header_params => header_params,
|
2525
|
+
:query_params => query_params,
|
2526
|
+
:form_params => form_params,
|
2527
|
+
:body => post_body,
|
2528
|
+
:auth_names => auth_names,
|
2529
|
+
:return_type => return_type
|
2530
|
+
)
|
2531
|
+
|
2532
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2533
|
+
if @api_client.config.debugging
|
2534
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_connected_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2535
|
+
end
|
2536
|
+
return data, status_code, headers
|
2537
|
+
end
|
2538
|
+
|
2070
2539
|
# List fields
|
2071
2540
|
# 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.
|
2072
2541
|
# @param [Hash] opts the optional parameters
|
@@ -3238,7 +3707,7 @@ module Tremendous
|
|
3238
3707
|
# @param id [String] ID of the campaign that should be updated
|
3239
3708
|
# @param update_campaign_request [UpdateCampaignRequest] Campaign details
|
3240
3709
|
# @param [Hash] opts the optional parameters
|
3241
|
-
# @return [
|
3710
|
+
# @return [CreateCampaign200Response]
|
3242
3711
|
def update_campaign(id, update_campaign_request, opts = {})
|
3243
3712
|
data, _status_code, _headers = update_campaign_with_http_info(id, update_campaign_request, opts)
|
3244
3713
|
data
|
@@ -3248,7 +3717,7 @@ module Tremendous
|
|
3248
3717
|
# @param id [String] ID of the campaign that should be updated
|
3249
3718
|
# @param update_campaign_request [UpdateCampaignRequest] Campaign details
|
3250
3719
|
# @param [Hash] opts the optional parameters
|
3251
|
-
# @return [Array<(
|
3720
|
+
# @return [Array<(CreateCampaign200Response, Integer, Hash)>] CreateCampaign200Response data, response status code and response headers
|
3252
3721
|
def update_campaign_with_http_info(id, update_campaign_request, opts = {})
|
3253
3722
|
if @api_client.config.debugging
|
3254
3723
|
@api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
|
@@ -3289,7 +3758,7 @@ module Tremendous
|
|
3289
3758
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_request)
|
3290
3759
|
|
3291
3760
|
# return_type
|
3292
|
-
return_type = opts[:debug_return_type] || '
|
3761
|
+
return_type = opts[:debug_return_type] || 'CreateCampaign200Response'
|
3293
3762
|
|
3294
3763
|
# auth_names
|
3295
3764
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|