Class: Brevo::EcommerceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/brevo/api/ecommerce_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EcommerceApi

Returns a new instance of EcommerceApi.



19
20
21
# File 'lib/brevo/api/ecommerce_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/brevo/api/ecommerce_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_batch_order(order_batch, opts = {}) ⇒ nil

Create orders in batch Create multiple orders at one time instead of one order at a time

Parameters:

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

    the optional parameters

Returns:

  • (nil)


37
38
39
40
# File 'lib/brevo/api/ecommerce_api.rb', line 37

def create_batch_order(order_batch, opts = {})
  create_batch_order_with_http_info(order_batch, opts)
  nil
end

#create_batch_order_with_http_info(order_batch, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create orders in batch Create multiple orders at one time instead of one order at a time

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/brevo/api/ecommerce_api.rb', line 47

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(order_batch)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#create_batch_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_order(order, opts = {}) ⇒ nil

Managing the status of the order Manages the transactional status of the order

Parameters:

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

    the optional parameters

Returns:

  • (nil)


90
91
92
93
# File 'lib/brevo/api/ecommerce_api.rb', line 90

def create_order(order, opts = {})
  create_order_with_http_info(order, opts)
  nil
end

#create_order_with_http_info(order, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Managing the status of the order Manages the transactional status of the order

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/brevo/api/ecommerce_api.rb', line 100

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(order)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_update_batch_category(create_update_batch_category, opts = {}) ⇒ CreateUpdateBatchCategoryModel

Create categories in batch

Parameters:

  • create_update_batch_category

    Values to create a batch of categories

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

    the optional parameters

Returns:



142
143
144
145
# File 'lib/brevo/api/ecommerce_api.rb', line 142

def create_update_batch_category(create_update_batch_category, opts = {})
  data, _status_code, _headers = create_update_batch_category_with_http_info(create_update_batch_category, opts)
  data
end

#create_update_batch_category_with_http_info(create_update_batch_category, opts = {}) ⇒ Array<(CreateUpdateBatchCategoryModel, Fixnum, Hash)>

Create categories in batch

Parameters:

  • create_update_batch_category

    Values to create a batch of categories

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

    the optional parameters

Returns:



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/brevo/api/ecommerce_api.rb', line 151

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_update_batch_category)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateUpdateBatchCategoryModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#create_update_batch_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_update_batch_products(create_update_batch_products, opts = {}) ⇒ CreateUpdateBatchProductsModel

Create products in batch

Parameters:

  • create_update_batch_products

    Values to create a batch of products

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

    the optional parameters

Returns:



194
195
196
197
# File 'lib/brevo/api/ecommerce_api.rb', line 194

def create_update_batch_products(create_update_batch_products, opts = {})
  data, _status_code, _headers = create_update_batch_products_with_http_info(create_update_batch_products, opts)
  data
end

#create_update_batch_products_with_http_info(create_update_batch_products, opts = {}) ⇒ Array<(CreateUpdateBatchProductsModel, Fixnum, Hash)>

Create products in batch

Parameters:

  • create_update_batch_products

    Values to create a batch of products

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

    the optional parameters

Returns:



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/brevo/api/ecommerce_api.rb', line 203

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_update_batch_products)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateUpdateBatchProductsModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#create_update_batch_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_update_category(create_update_category, opts = {}) ⇒ CreateCategoryModel

Create/Update a category

Parameters:

  • create_update_category

    Values to create/update a category

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

    the optional parameters

Returns:



246
247
248
249
# File 'lib/brevo/api/ecommerce_api.rb', line 246

def create_update_category(create_update_category, opts = {})
  data, _status_code, _headers = create_update_category_with_http_info(create_update_category, opts)
  data
end

#create_update_category_with_http_info(create_update_category, opts = {}) ⇒ Array<(CreateCategoryModel, Fixnum, Hash)>

Create/Update a category

Parameters:

  • create_update_category

    Values to create/update a category

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

    the optional parameters

Returns:

  • (Array<(CreateCategoryModel, Fixnum, Hash)>)

    CreateCategoryModel data, response status code and response headers



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/brevo/api/ecommerce_api.rb', line 255

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_update_category)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateCategoryModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#create_update_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_update_product(create_update_product, opts = {}) ⇒ CreateProductModel

Create/Update a product

Parameters:

  • create_update_product

    Values to create/update a product

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

    the optional parameters

Returns:



298
299
300
301
# File 'lib/brevo/api/ecommerce_api.rb', line 298

def create_update_product(create_update_product, opts = {})
  data, _status_code, _headers = create_update_product_with_http_info(create_update_product, opts)
  data
end

#create_update_product_with_http_info(create_update_product, opts = {}) ⇒ Array<(CreateProductModel, Fixnum, Hash)>

Create/Update a product

Parameters:

  • create_update_product

    Values to create/update a product

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

    the optional parameters

Returns:

  • (Array<(CreateProductModel, Fixnum, Hash)>)

    CreateProductModel data, response status code and response headers



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/brevo/api/ecommerce_api.rb', line 307

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_update_product)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateProductModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#create_update_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ecommerce_activate_post(opts = {}) ⇒ nil

Activate the eCommerce app Getting access to Brevo eCommerce.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


350
351
352
353
# File 'lib/brevo/api/ecommerce_api.rb', line 350

def ecommerce_activate_post(opts = {})
  ecommerce_activate_post_with_http_info(opts)
  nil
end

#ecommerce_activate_post_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Activate the eCommerce app Getting access to Brevo eCommerce.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/brevo/api/ecommerce_api.rb', line 359

def ecommerce_activate_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.ecommerce_activate_post ...'
  end
  # resource path
  local_var_path = '/ecommerce/activate'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#ecommerce_activate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ecommerce_attribution_metrics_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id, opts = {}) ⇒ InlineResponse2007

Get detailed attribution metrics for a single Brevo campaign or workflow

Parameters:

  • conversion_source

    The Brevo campaign type or workflow type for which data will be retrieved

  • conversion_source_id

    The Brevo campaign or automation workflow id for which data will be retrieved

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

    the optional parameters

Returns:



398
399
400
401
# File 'lib/brevo/api/ecommerce_api.rb', line 398

def ecommerce_attribution_metrics_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id, opts = {})
  data, _status_code, _headers = ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id, opts)
  data
end

#ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id, opts = {}) ⇒ Array<(InlineResponse2007, Fixnum, Hash)>

Get detailed attribution metrics for a single Brevo campaign or workflow

Parameters:

  • conversion_source

    The Brevo campaign type or workflow type for which data will be retrieved

  • conversion_source_id

    The Brevo campaign or automation workflow id for which data will be retrieved

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

    the optional parameters

Returns:

  • (Array<(InlineResponse2007, Fixnum, Hash)>)

    InlineResponse2007 data, response status code and response headers



408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/brevo/api/ecommerce_api.rb', line 408

def ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.ecommerce_attribution_metrics_conversion_source_conversion_source_id_get ...'
  end
  # verify the required parameter 'conversion_source' is set
  if @api_client.config.client_side_validation && conversion_source.nil?
    fail ArgumentError, "Missing the required parameter 'conversion_source' when calling EcommerceApi.ecommerce_attribution_metrics_conversion_source_conversion_source_id_get"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['email_campaign', 'sms_campaign', 'automation_workflow_email', 'automation_workflow_sms'].include?(conversion_source)
    fail ArgumentError, "invalid value for 'conversion_source', must be one of email_campaign, sms_campaign, automation_workflow_email, automation_workflow_sms"
  end
  # verify the required parameter 'conversion_source_id' is set
  if @api_client.config.client_side_validation && conversion_source_id.nil?
    fail ArgumentError, "Missing the required parameter 'conversion_source_id' when calling EcommerceApi.ecommerce_attribution_metrics_conversion_source_conversion_source_id_get"
  end
  # resource path
  local_var_path = '/ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId}'.sub('{' + 'conversionSource' + '}', conversion_source.to_s).sub('{' + 'conversionSourceId' + '}', conversion_source_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2007')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#ecommerce_attribution_metrics_conversion_source_conversion_source_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ecommerce_attribution_metrics_get(opts = {}) ⇒ InlineResponse2006

Get attribution metrics for one or more Brevo campaigns or workflows

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :period_from (DateTime)

    When getting metrics for a specific period, define the starting datetime in RFC3339 format

  • :period_to (DateTime)

    When getting metrics for a specific period, define the end datetime in RFC3339 format

  • :email_campaign_id (Array<String>)

    The email campaign ID(s) to get metrics for

  • :sms_campaign_id (Array<String>)

    The SMS campaign ID(s) to get metrics for

  • :automation_workflow_email_id (Array<String>)

    The automation workflow ID(s) to get email attribution metrics for

  • :automation_workflow_sms_id (Array<String>)

    The automation workflow ID(s) to get SMS attribution metrics for

Returns:



464
465
466
467
# File 'lib/brevo/api/ecommerce_api.rb', line 464

def ecommerce_attribution_metrics_get(opts = {})
  data, _status_code, _headers = ecommerce_attribution_metrics_get_with_http_info(opts)
  data
end

#ecommerce_attribution_metrics_get_with_http_info(opts = {}) ⇒ Array<(InlineResponse2006, Fixnum, Hash)>

Get attribution metrics for one or more Brevo campaigns or workflows

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :period_from (DateTime)

    When getting metrics for a specific period, define the starting datetime in RFC3339 format

  • :period_to (DateTime)

    When getting metrics for a specific period, define the end datetime in RFC3339 format

  • :email_campaign_id (Array<String>)

    The email campaign ID(s) to get metrics for

  • :sms_campaign_id (Array<String>)

    The SMS campaign ID(s) to get metrics for

  • :automation_workflow_email_id (Array<String>)

    The automation workflow ID(s) to get email attribution metrics for

  • :automation_workflow_sms_id (Array<String>)

    The automation workflow ID(s) to get SMS attribution metrics for

Returns:

  • (Array<(InlineResponse2006, Fixnum, Hash)>)

    InlineResponse2006 data, response status code and response headers



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/brevo/api/ecommerce_api.rb', line 478

def ecommerce_attribution_metrics_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.ecommerce_attribution_metrics_get ...'
  end
  # resource path
  local_var_path = '/ecommerce/attribution/metrics'

  # query parameters
  query_params = {}
  query_params[:'periodFrom'] = opts[:'period_from'] if !opts[:'period_from'].nil?
  query_params[:'periodTo'] = opts[:'period_to'] if !opts[:'period_to'].nil?
  query_params[:'emailCampaignId[]'] = @api_client.build_collection_param(opts[:'email_campaign_id'], :csv) if !opts[:'email_campaign_id'].nil?
  query_params[:'smsCampaignId[]'] = @api_client.build_collection_param(opts[:'sms_campaign_id'], :csv) if !opts[:'sms_campaign_id'].nil?
  query_params[:'automationWorkflowEmailId[]'] = @api_client.build_collection_param(opts[:'automation_workflow_email_id'], :csv) if !opts[:'automation_workflow_email_id'].nil?
  query_params[:'automationWorkflowSmsId[]'] = @api_client.build_collection_param(opts[:'automation_workflow_sms_id'], :csv) if !opts[:'automation_workflow_sms_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2006')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#ecommerce_attribution_metrics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ecommerce_attribution_products_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id, opts = {}) ⇒ InlineResponse2008

Get attributed product sales for a single Brevo campaign or workflow

Parameters:

  • conversion_source

    The Brevo campaign or automation workflow type for which data will be retrieved

  • conversion_source_id

    The Brevo campaign or automation workflow id for which data will be retrieved

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

    the optional parameters

Returns:



524
525
526
527
# File 'lib/brevo/api/ecommerce_api.rb', line 524

def ecommerce_attribution_products_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id, opts = {})
  data, _status_code, _headers = ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id, opts)
  data
end

#ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id, opts = {}) ⇒ Array<(InlineResponse2008, Fixnum, Hash)>

Get attributed product sales for a single Brevo campaign or workflow

Parameters:

  • conversion_source

    The Brevo campaign or automation workflow type for which data will be retrieved

  • conversion_source_id

    The Brevo campaign or automation workflow id for which data will be retrieved

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

    the optional parameters

Returns:

  • (Array<(InlineResponse2008, Fixnum, Hash)>)

    InlineResponse2008 data, response status code and response headers



534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/brevo/api/ecommerce_api.rb', line 534

def ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.ecommerce_attribution_products_conversion_source_conversion_source_id_get ...'
  end
  # verify the required parameter 'conversion_source' is set
  if @api_client.config.client_side_validation && conversion_source.nil?
    fail ArgumentError, "Missing the required parameter 'conversion_source' when calling EcommerceApi.ecommerce_attribution_products_conversion_source_conversion_source_id_get"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['email_campaign', 'sms_campaign', 'automation_workflow_email', 'automation_workflow_sms'].include?(conversion_source)
    fail ArgumentError, "invalid value for 'conversion_source', must be one of email_campaign, sms_campaign, automation_workflow_email, automation_workflow_sms"
  end
  # verify the required parameter 'conversion_source_id' is set
  if @api_client.config.client_side_validation && conversion_source_id.nil?
    fail ArgumentError, "Missing the required parameter 'conversion_source_id' when calling EcommerceApi.ecommerce_attribution_products_conversion_source_conversion_source_id_get"
  end
  # resource path
  local_var_path = '/ecommerce/attribution/products/{conversionSource}/{conversionSourceId}'.sub('{' + 'conversionSource' + '}', conversion_source.to_s).sub('{' + 'conversionSourceId' + '}', conversion_source_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2008')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#ecommerce_attribution_products_conversion_source_conversion_source_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ecommerce_config_display_currency_get(opts = {}) ⇒ InlineResponse2005

Get the ISO 4217 compliant display currency code for your Brevo account

Parameters:

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

    the optional parameters

Returns:



584
585
586
587
# File 'lib/brevo/api/ecommerce_api.rb', line 584

def ecommerce_config_display_currency_get(opts = {})
  data, _status_code, _headers = ecommerce_config_display_currency_get_with_http_info(opts)
  data
end

#ecommerce_config_display_currency_get_with_http_info(opts = {}) ⇒ Array<(InlineResponse2005, Fixnum, Hash)>

Get the ISO 4217 compliant display currency code for your Brevo account

Parameters:

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

    the optional parameters

Returns:

  • (Array<(InlineResponse2005, Fixnum, Hash)>)

    InlineResponse2005 data, response status code and response headers



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/brevo/api/ecommerce_api.rb', line 592

def ecommerce_config_display_currency_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.ecommerce_config_display_currency_get ...'
  end
  # resource path
  local_var_path = '/ecommerce/config/displayCurrency'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2005')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#ecommerce_config_display_currency_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_categories(opts = {}) ⇒ GetCategories

Return all your categories

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 50)

  • :offset (Integer)

    Index of the first document in the page (default to 0)

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

  • :ids (Array<String>)

    Filter by category ids

  • :name (String)

    Filter by category name

  • :modified_since (String)

    Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

  • :created_since (String)

    Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

Returns:



637
638
639
640
# File 'lib/brevo/api/ecommerce_api.rb', line 637

def get_categories(opts = {})
  data, _status_code, _headers = get_categories_with_http_info(opts)
  data
end

#get_categories_with_http_info(opts = {}) ⇒ Array<(GetCategories, Fixnum, Hash)>

Return all your categories

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document in the page

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

  • :ids (Array<String>)

    Filter by category ids

  • :name (String)

    Filter by category name

  • :modified_since (String)

    Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

  • :created_since (String)

    Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

Returns:

  • (Array<(GetCategories, Fixnum, Hash)>)

    GetCategories data, response status code and response headers



652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/brevo/api/ecommerce_api.rb', line 652

def get_categories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.get_categories ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EcommerceApi.get_categories, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  end
  # resource path
  local_var_path = '/categories'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'ids'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?
  query_params[:'createdSince'] = opts[:'created_since'] if !opts[:'created_since'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetCategories')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#get_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_category_info(id, opts = {}) ⇒ GetCategoryDetails

Get a category details

Parameters:

  • id

    Category ID

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

    the optional parameters

Returns:



705
706
707
708
# File 'lib/brevo/api/ecommerce_api.rb', line 705

def get_category_info(id, opts = {})
  data, _status_code, _headers = get_category_info_with_http_info(id, opts)
  data
end

#get_category_info_with_http_info(id, opts = {}) ⇒ Array<(GetCategoryDetails, Fixnum, Hash)>

Get a category details

Parameters:

  • id

    Category ID

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

    the optional parameters

Returns:

  • (Array<(GetCategoryDetails, Fixnum, Hash)>)

    GetCategoryDetails data, response status code and response headers



714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
# File 'lib/brevo/api/ecommerce_api.rb', line 714

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetCategoryDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#get_category_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orders(opts = {}) ⇒ GetOrders

Get order details Get all the orders

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 50)

  • :offset (Integer)

    Index of the first document in the page (default to 0)

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

  • :modified_since (String)

    Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

  • :created_since (String)

    Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

Returns:



762
763
764
765
# File 'lib/brevo/api/ecommerce_api.rb', line 762

def get_orders(opts = {})
  data, _status_code, _headers = get_orders_with_http_info(opts)
  data
end

#get_orders_with_http_info(opts = {}) ⇒ Array<(GetOrders, Fixnum, Hash)>

Get order details Get all the orders

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document in the page

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

  • :modified_since (String)

    Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

  • :created_since (String)

    Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

Returns:

  • (Array<(GetOrders, Fixnum, Hash)>)

    GetOrders data, response status code and response headers



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/brevo/api/ecommerce_api.rb', line 776

def get_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.get_orders ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EcommerceApi.get_orders, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?
  query_params[:'createdSince'] = opts[:'created_since'] if !opts[:'created_since'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetOrders')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#get_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_product_info(id, opts = {}) ⇒ GetProductDetails

Get a product’s details

Parameters:

  • id

    Product ID

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

    the optional parameters

Returns:



827
828
829
830
# File 'lib/brevo/api/ecommerce_api.rb', line 827

def get_product_info(id, opts = {})
  data, _status_code, _headers = get_product_info_with_http_info(id, opts)
  data
end

#get_product_info_with_http_info(id, opts = {}) ⇒ Array<(GetProductDetails, Fixnum, Hash)>

Get a product&#39;s details

Parameters:

  • id

    Product ID

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

    the optional parameters

Returns:

  • (Array<(GetProductDetails, Fixnum, Hash)>)

    GetProductDetails data, response status code and response headers



836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'lib/brevo/api/ecommerce_api.rb', line 836

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetProductDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#get_product_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_products(opts = {}) ⇒ GetProducts

Return all your products

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 50)

  • :offset (Integer)

    Index of the first document in the page (default to 0)

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed (default to desc)

  • :ids (Array<String>)

    Filter by product ids

  • :name (String)

    Filter by product name, minimum 3 characters should be present for search

  • :price_lte (Float)

    Price filter for products less than and equals to particular amount

  • :price_gte (Float)

    Price filter for products greater than and equals to particular amount

  • :price_lt (Float)

    Price filter for products less than particular amount

  • :price_gt (Float)

    Price filter for products greater than particular amount

  • :price_eq (Float)

    Price filter for products equals to particular amount

  • :price_ne (Float)

    Price filter for products not equals to particular amount

  • :categories (Array<String>)

    Filter by category ids

  • :modified_since (String)

    Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

  • :created_since (String)

    Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

Returns:



892
893
894
895
# File 'lib/brevo/api/ecommerce_api.rb', line 892

def get_products(opts = {})
  data, _status_code, _headers = get_products_with_http_info(opts)
  data
end

#get_products_with_http_info(opts = {}) ⇒ Array<(GetProducts, Fixnum, Hash)>

Return all your products

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document in the page

  • :sort (String)

    Sort the results in the ascending/descending order of record creation. Default order is descending if &#x60;sort&#x60; is not passed

  • :ids (Array<String>)

    Filter by product ids

  • :name (String)

    Filter by product name, minimum 3 characters should be present for search

  • :price_lte (Float)

    Price filter for products less than and equals to particular amount

  • :price_gte (Float)

    Price filter for products greater than and equals to particular amount

  • :price_lt (Float)

    Price filter for products less than particular amount

  • :price_gt (Float)

    Price filter for products greater than particular amount

  • :price_eq (Float)

    Price filter for products equals to particular amount

  • :price_ne (Float)

    Price filter for products not equals to particular amount

  • :categories (Array<String>)

    Filter by category ids

  • :modified_since (String)

    Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

  • :created_since (String)

    Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**

Returns:

  • (Array<(GetProducts, Fixnum, Hash)>)

    GetProducts data, response status code and response headers



914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
# File 'lib/brevo/api/ecommerce_api.rb', line 914

def get_products_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EcommerceApi.get_products ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EcommerceApi.get_products, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
  end
  # resource path
  local_var_path = '/products'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'ids'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'price[lte]'] = opts[:'price_lte'] if !opts[:'price_lte'].nil?
  query_params[:'price[gte]'] = opts[:'price_gte'] if !opts[:'price_gte'].nil?
  query_params[:'price[lt]'] = opts[:'price_lt'] if !opts[:'price_lt'].nil?
  query_params[:'price[gt]'] = opts[:'price_gt'] if !opts[:'price_gt'].nil?
  query_params[:'price[eq]'] = opts[:'price_eq'] if !opts[:'price_eq'].nil?
  query_params[:'price[ne]'] = opts[:'price_ne'] if !opts[:'price_ne'].nil?
  query_params[:'categories'] = @api_client.build_collection_param(opts[:'categories'], :csv) if !opts[:'categories'].nil?
  query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?
  query_params[:'createdSince'] = opts[:'created_since'] if !opts[:'created_since'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetProducts')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#get_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_config_display_currency(set_config_display_currency, opts = {}) ⇒ SetConfigDisplayCurrency

Set the ISO 4217 compliant display currency code for your Brevo account

Parameters:

  • set_config_display_currency

    set ISO 4217 compliant display currency code payload

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

    the optional parameters

Returns:



974
975
976
977
# File 'lib/brevo/api/ecommerce_api.rb', line 974

def set_config_display_currency(set_config_display_currency, opts = {})
  data, _status_code, _headers = set_config_display_currency_with_http_info(set_config_display_currency, opts)
  data
end

#set_config_display_currency_with_http_info(set_config_display_currency, opts = {}) ⇒ Array<(SetConfigDisplayCurrency, Fixnum, Hash)>

Set the ISO 4217 compliant display currency code for your Brevo account

Parameters:

  • set_config_display_currency

    set ISO 4217 compliant display currency code payload

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

    the optional parameters

Returns:

  • (Array<(SetConfigDisplayCurrency, Fixnum, Hash)>)

    SetConfigDisplayCurrency data, response status code and response headers



983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/brevo/api/ecommerce_api.rb', line 983

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(set_config_display_currency)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SetConfigDisplayCurrency')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EcommerceApi#set_config_display_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#setUserAgent(user_agent) ⇒ Object

Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#VERSION/ruby



25
26
27
28
29
30
# File 'lib/brevo/api/ecommerce_api.rb', line 25

def setUserAgent(user_agent)
  @user_agent = user_agent
  if user_agent.is_a?(String) && user_agent.downcase.start_with?('brevo_')
    @api_client.default_headers['User-Agent'] = @user_agent
  end
end