Skip to content

Latest commit

 

History

History
1121 lines (814 loc) · 37.6 KB

EcommerceApi.md

File metadata and controls

1121 lines (814 loc) · 37.6 KB

Brevo::EcommerceApi

All URIs are relative to https://api.brevo.com/v3

Method HTTP request Description
create_batch_order POST /orders/status/batch Create orders in batch
create_order POST /orders/status Managing the status of the order
create_update_batch_category POST /categories/batch Create categories in batch
create_update_batch_products POST /products/batch Create products in batch
create_update_category POST /categories Create/Update a category
create_update_product POST /products Create/Update a product
ecommerce_activate_post POST /ecommerce/activate Activate the eCommerce app
ecommerce_attribution_metrics_conversion_source_conversion_source_id_get GET /ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId} Get detailed attribution metrics for a single Brevo campaign
ecommerce_attribution_metrics_get GET /ecommerce/attribution/metrics Get attribution metrics for one or more Brevo campaigns
ecommerce_attribution_products_conversion_source_conversion_source_id_get GET /ecommerce/attribution/products/{conversionSource}/{conversionSourceId} Get attributed product sales for a single Brevo campaign
get_categories GET /categories Return all your categories
get_category_info GET /categories/{id} Get a category details
get_orders GET /orders Get order details
get_product_info GET /products/{id} Get a product's details
get_products GET /products Return all your products

create_batch_order

create_batch_order(order_batch)

Create orders in batch

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

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
order_batch = Brevo::OrderBatch.new({orders: [Brevo::Order.new({id: '14', created_at: '2021-07-29T20:59:23.383Z', updated_at: '2021-07-30T10:59:23.383Z', status: 'completed', amount: 308.42, products: [Brevo::OrderProductsInner.new({product_id: 'P1', quantity: 10, price: 99.99})]})]}) # OrderBatch | 

begin
  # Create orders in batch
  result = api_instance.create_batch_order(order_batch)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_batch_order: #{e}"
end

Using the create_batch_order_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_batch_order_with_http_info(order_batch)

begin
  # Create orders in batch
  data, status_code, headers = api_instance.create_batch_order_with_http_info(order_batch)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreatedBatchId>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_batch_order_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
order_batch OrderBatch

Return type

CreatedBatchId

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_order

create_order(order)

Managing the status of the order

Manages the transactional status of the order

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
order = Brevo::Order.new({id: '14', created_at: '2021-07-29T20:59:23.383Z', updated_at: '2021-07-30T10:59:23.383Z', status: 'completed', amount: 308.42, products: [Brevo::OrderProductsInner.new({product_id: 'P1', quantity: 10, price: 99.99})]}) # Order | 

begin
  # Managing the status of the order
  api_instance.create_order(order)
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_order: #{e}"
end

Using the create_order_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> create_order_with_http_info(order)

begin
  # Managing the status of the order
  data, status_code, headers = api_instance.create_order_with_http_info(order)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_order_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
order Order

Return type

nil (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_update_batch_category

create_update_batch_category(create_update_batch_category)

Create categories in batch

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
create_update_batch_category = Brevo::CreateUpdateBatchCategory.new({categories: [Brevo::CreateUpdateCategories.new({id: 'CAT123'})]}) # CreateUpdateBatchCategory | Values to create a batch of categories

begin
  # Create categories in batch
  result = api_instance.create_update_batch_category(create_update_batch_category)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_batch_category: #{e}"
end

Using the create_update_batch_category_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_update_batch_category_with_http_info(create_update_batch_category)

begin
  # Create categories in batch
  data, status_code, headers = api_instance.create_update_batch_category_with_http_info(create_update_batch_category)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateUpdateBatchCategoryModel>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_batch_category_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_update_batch_category CreateUpdateBatchCategory Values to create a batch of categories

Return type

CreateUpdateBatchCategoryModel

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_update_batch_products

create_update_batch_products(create_update_batch_products)

Create products in batch

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
create_update_batch_products = Brevo::CreateUpdateBatchProducts.new({products: [Brevo::CreateUpdateProducts.new({id: 'P11', name: 'Iphone 11'})]}) # CreateUpdateBatchProducts | Values to create a batch of products

begin
  # Create products in batch
  result = api_instance.create_update_batch_products(create_update_batch_products)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_batch_products: #{e}"
end

Using the create_update_batch_products_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_update_batch_products_with_http_info(create_update_batch_products)

begin
  # Create products in batch
  data, status_code, headers = api_instance.create_update_batch_products_with_http_info(create_update_batch_products)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateUpdateBatchProductsModel>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_batch_products_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_update_batch_products CreateUpdateBatchProducts Values to create a batch of products

Return type

CreateUpdateBatchProductsModel

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_update_category

create_update_category(create_update_category)

Create/Update a category

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
create_update_category = Brevo::CreateUpdateCategory.new({id: 'CAT123'}) # CreateUpdateCategory | Values to create/update a category

begin
  # Create/Update a category
  result = api_instance.create_update_category(create_update_category)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_category: #{e}"
end

Using the create_update_category_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_update_category_with_http_info(create_update_category)

begin
  # Create/Update a category
  data, status_code, headers = api_instance.create_update_category_with_http_info(create_update_category)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateCategoryModel>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_category_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_update_category CreateUpdateCategory Values to create/update a category

Return type

CreateCategoryModel

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_update_product

create_update_product(create_update_product)

Create/Update a product

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
create_update_product = Brevo::CreateUpdateProduct.new({id: 'P11', name: 'Iphone 11'}) # CreateUpdateProduct | Values to create/update a product

begin
  # Create/Update a product
  result = api_instance.create_update_product(create_update_product)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_product: #{e}"
end

Using the create_update_product_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_update_product_with_http_info(create_update_product)

begin
  # Create/Update a product
  data, status_code, headers = api_instance.create_update_product_with_http_info(create_update_product)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateProductModel>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->create_update_product_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_update_product CreateUpdateProduct Values to create/update a product

Return type

CreateProductModel

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

ecommerce_activate_post

ecommerce_activate_post

Activate the eCommerce app

Getting access to Brevo eCommerce.

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new

begin
  # Activate the eCommerce app
  api_instance.ecommerce_activate_post
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_activate_post: #{e}"
end

Using the ecommerce_activate_post_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> ecommerce_activate_post_with_http_info

begin
  # Activate the eCommerce app
  data, status_code, headers = api_instance.ecommerce_activate_post_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_activate_post_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

nil (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

ecommerce_attribution_metrics_conversion_source_conversion_source_id_get

ecommerce_attribution_metrics_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id)

Get detailed attribution metrics for a single Brevo campaign

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
conversion_source = 'email_campaign' # String | The Brevo campaign type for which data will be retrieved
conversion_source_id = 1 # Float | The Brevo campaign id for which data will be retrieved

begin
  # Get detailed attribution metrics for a single Brevo campaign
  result = api_instance.ecommerce_attribution_metrics_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_attribution_metrics_conversion_source_conversion_source_id_get: #{e}"
end

Using the ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id)

begin
  # Get detailed attribution metrics for a single Brevo campaign
  data, status_code, headers = api_instance.ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_attribution_metrics_conversion_source_conversion_source_id_get_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
conversion_source String The Brevo campaign type for which data will be retrieved
conversion_source_id Float The Brevo campaign id for which data will be retrieved

Return type

EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

ecommerce_attribution_metrics_get

ecommerce_attribution_metrics_get(opts)

Get attribution metrics for one or more Brevo campaigns

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
opts = {
  period_from: Time.parse('2022-01-02T00:00Z'), # Time | When getting metrics for a specific period, define the starting datetime in RFC3339 format
  period_to: Time.parse('2022-01-03T00:00Z'), # Time | When getting metrics for a specific period, define the end datetime in RFC3339 format
  email_campaign_id: [1] # Array<Float> | The email campaign id(s) to get metrics for
}

begin
  # Get attribution metrics for one or more Brevo campaigns
  result = api_instance.ecommerce_attribution_metrics_get(opts)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_attribution_metrics_get: #{e}"
end

Using the ecommerce_attribution_metrics_get_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> ecommerce_attribution_metrics_get_with_http_info(opts)

begin
  # Get attribution metrics for one or more Brevo campaigns
  data, status_code, headers = api_instance.ecommerce_attribution_metrics_get_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <EcommerceAttributionMetricsGet200Response>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_attribution_metrics_get_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
period_from Time When getting metrics for a specific period, define the starting datetime in RFC3339 format [optional]
period_to Time When getting metrics for a specific period, define the end datetime in RFC3339 format [optional]
email_campaign_id Array<Float> The email campaign id(s) to get metrics for [optional]

Return type

EcommerceAttributionMetricsGet200Response

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

ecommerce_attribution_products_conversion_source_conversion_source_id_get

ecommerce_attribution_products_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id)

Get attributed product sales for a single Brevo campaign

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
conversion_source = 'email_campaign' # String | The Brevo campaign type for which data will be retrieved
conversion_source_id = 1 # Float | The Brevo campaign id for which data will be retrieved

begin
  # Get attributed product sales for a single Brevo campaign
  result = api_instance.ecommerce_attribution_products_conversion_source_conversion_source_id_get(conversion_source, conversion_source_id)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_attribution_products_conversion_source_conversion_source_id_get: #{e}"
end

Using the ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id)

begin
  # Get attributed product sales for a single Brevo campaign
  data, status_code, headers = api_instance.ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info(conversion_source, conversion_source_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->ecommerce_attribution_products_conversion_source_conversion_source_id_get_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
conversion_source String The Brevo campaign type for which data will be retrieved
conversion_source_id Float The Brevo campaign id for which data will be retrieved

Return type

EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_categories

get_categories(opts)

Return all your categories

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
opts = {
  limit: 789, # Integer | Number of documents per page
  offset: 789, # Integer | Index of the first document in the page
  sort: 'asc', # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
  ids: ['inner_example'], # Array<String> | Filter by category ids
  name: 'name_example', # String | Filter by category name
  modified_since: 'modified_since_example', # 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: 'created_since_example' # 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.** 
}

begin
  # Return all your categories
  result = api_instance.get_categories(opts)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_categories: #{e}"
end

Using the get_categories_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_categories_with_http_info(opts)

begin
  # Return all your categories
  data, status_code, headers = api_instance.get_categories_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetCategories>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_categories_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
limit Integer Number of documents per page [optional][default to 50]
offset Integer Index of the first document in the page [optional][default to 0]
sort String Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional][default to 'desc']
ids Array<String> Filter by category ids [optional]
name String Filter by category name [optional]
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. [optional]
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. [optional]

Return type

GetCategories

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_category_info

get_category_info(id)

Get a category details

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
id = 'id_example' # String | Category ID

begin
  # Get a category details
  result = api_instance.get_category_info(id)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_category_info: #{e}"
end

Using the get_category_info_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_category_info_with_http_info(id)

begin
  # Get a category details
  data, status_code, headers = api_instance.get_category_info_with_http_info(id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetCategoryDetails>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_category_info_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String Category ID

Return type

GetCategoryDetails

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_orders

get_orders(opts)

Get order details

Get all the orders

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
opts = {
  limit: 789, # Integer | Number of documents per page
  offset: 789, # Integer | Index of the first document in the page
  sort: 'asc', # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
  modified_since: 'modified_since_example', # 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: 'created_since_example' # 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.** 
}

begin
  # Get order details
  api_instance.get_orders(opts)
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_orders: #{e}"
end

Using the get_orders_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> get_orders_with_http_info(opts)

begin
  # Get order details
  data, status_code, headers = api_instance.get_orders_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_orders_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
limit Integer Number of documents per page [optional][default to 50]
offset Integer Index of the first document in the page [optional][default to 0]
sort String Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional][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. [optional]
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. [optional]

Return type

nil (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_product_info

get_product_info(id)

Get a product's details

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
id = 'id_example' # String | Product ID

begin
  # Get a product's details
  result = api_instance.get_product_info(id)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_product_info: #{e}"
end

Using the get_product_info_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_product_info_with_http_info(id)

begin
  # Get a product's details
  data, status_code, headers = api_instance.get_product_info_with_http_info(id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetProductDetails>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_product_info_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String Product ID

Return type

GetProductDetails

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_products

get_products(opts)

Return all your products

Examples

require 'time'
require 'brevo'
# setup authorization
Brevo.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api-key'] = 'Bearer'
end

api_instance = Brevo::EcommerceApi.new
opts = {
  limit: 789, # Integer | Number of documents per page
  offset: 789, # Integer | Index of the first document in the page
  sort: 'asc', # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
  ids: ['inner_example'], # Array<String> | Filter by product ids
  name: 'name_example', # String | Filter by product name, minimum 3 characters should be present for search
  price_lte: 8.14, # Float | Price filter for products less than and equals to particular amount
  price_gte: 8.14, # Float | Price filter for products greater than and equals to particular amount
  price_lt: 8.14, # Float | Price filter for products less than particular amount
  price_gt: 8.14, # Float | Price filter for products greater than particular amount
  price_eq: 8.14, # Float | Price filter for products equals to particular amount
  price_ne: 8.14, # Float | Price filter for products not equals to particular amount
  categories: ['inner_example'], # Array<String> | Filter by product categories
  modified_since: 'modified_since_example', # 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: 'created_since_example' # 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.** 
}

begin
  # Return all your products
  result = api_instance.get_products(opts)
  p result
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_products: #{e}"
end

Using the get_products_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_products_with_http_info(opts)

begin
  # Return all your products
  data, status_code, headers = api_instance.get_products_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetProducts>
rescue Brevo::ApiError => e
  puts "Error when calling EcommerceApi->get_products_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
limit Integer Number of documents per page [optional][default to 50]
offset Integer Index of the first document in the page [optional][default to 0]
sort String Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional][default to 'desc']
ids Array<String> Filter by product ids [optional]
name String Filter by product name, minimum 3 characters should be present for search [optional]
price_lte Float Price filter for products less than and equals to particular amount [optional]
price_gte Float Price filter for products greater than and equals to particular amount [optional]
price_lt Float Price filter for products less than particular amount [optional]
price_gt Float Price filter for products greater than particular amount [optional]
price_eq Float Price filter for products equals to particular amount [optional]
price_ne Float Price filter for products not equals to particular amount [optional]
categories Array<String> Filter by product categories [optional]
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. [optional]
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. [optional]

Return type

GetProducts

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json