voxbone v0.2.0 Voxbone.Api.Ordering
API calls for all endpoints tagged Ordering
.
Link to this section Summary
Functions
Retrieve information about your account balance. You may need to check your account balance before checking out your carts. This is not mandatory, but checking out a cart with an empty balance will return an error. Note that you can set up a threshold for automatic refills of your business account. This threshold is configurable both on the web portal and the API. We recommend that this automatic refill parameter is set to true, especially when using the API for ordering
Allows you to add items (orderProducts) to a specific cart before checking out the cart. Different product types (DID, CAPACITY or CREDIT_PACKAGE) can be added into one single cart. However, only one product can be added per addToCart request. The system will automatically create a new orderProductId (or add the items to an existing one) for the items added to your cart. You can retrieve the orderProductId with the listCart method. When you order capacity you should update your capacity forecast (in the portal). The delivery of capacity is not in real-time and requires validation from our operation team
Allows you to cancel one or multiple DIDs
Allows you to checkout a cart and place an order for all the products contained in the cart. You can then retrieve your orders using the listOrder method
Allows you to create a cart. The creation of a cart depends on your own business logic, but you'll always need to create at least one cart to place an order (checkoutCart). You can place multiple orders per cart or you can create separate carts for each order. Note that different product types (DID, Capacity or prepaid credits) can be added into one single cart
Allows you to delete a cart and all its content from your list of carts
Allows you to retrieve your cart attributes (cartIdentifier, customerReference, description) and its content (list of products - orderProducts - that are currently in the cart)
Allows you to list your carts and retrieve their attributes (cartIdentifier, customerReference, description), and their content (list of products - orderProducts - that are currently in the cart)
Allows you to get a list of your orders (after a cart has been checked out) and their status
Remove a product from your cart, or change the ordered quantity
Link to this section Functions
account_balance(Tesla.Env.client(), keyword()) :: {:ok, Voxbone.Model.AccountBalanceResponse.t()} | {:error, Tesla.Env.t()}
Retrieve information about your account balance. You may need to check your account balance before checking out your carts. This is not mandatory, but checking out a cart with an empty balance will return an error. Note that you can set up a threshold for automatic refills of your business account. This threshold is configurable both on the web portal and the API. We recommend that this automatic refill parameter is set to true, especially when using the API for ordering.
Parameters
- connection (Voxbone.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
Returns
{:ok, %Voxbone.Model.AccountBalanceResponse{}} on success {:error, info} on failure
add_to_cart(Tesla.Env.client(), integer(), keyword()) :: {:ok, Voxbone.Model.AddToCartResponse.t()} | {:error, Tesla.Env.t()}
Allows you to add items (orderProducts) to a specific cart before checking out the cart. Different product types (DID, CAPACITY or CREDIT_PACKAGE) can be added into one single cart. However, only one product can be added per addToCart request. The system will automatically create a new orderProductId (or add the items to an existing one) for the items added to your cart. You can retrieve the orderProductId with the listCart method. When you order capacity you should update your capacity forecast (in the portal). The delivery of capacity is not in real-time and requires validation from our operation team.
Parameters
- connection (Voxbone.Connection): Connection to server
- cart_identifier (integer()): Identifies the cart and is returned by the createCart method or can be retrieved with the listCart method.
opts (KeywordList): [optional] Optional parameters
- :body (AddToCartRequest):
Returns
{:ok, %Voxbone.Model.AddToCartResponse{}} on success {:error, info} on failure
cancel_dids(Tesla.Env.client(), keyword()) :: {:ok, Voxbone.Model.CancelDidsResponse.t()} | {:error, Tesla.Env.t()}
Allows you to cancel one or multiple DIDs.
Parameters
- connection (Voxbone.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :body (CancelDidsRequest):
Returns
{:ok, %Voxbone.Model.CancelDidsResponse{}} on success {:error, info} on failure
checkout_cart(Tesla.Env.client(), integer(), keyword()) :: {:ok, Voxbone.Model.CheckoutCartResponse.t()} | {:error, Tesla.Env.t()}
Allows you to checkout a cart and place an order for all the products contained in the cart. You can then retrieve your orders using the listOrder method.
Parameters
- connection (Voxbone.Connection): Connection to server
- cart_identifier (integer()): The identifier of your cart which is formed of a fixed string such as 'apiv3:60677:' and an ID which is incremented each time a new cart is created.
- opts (KeywordList): [optional] Optional parameters
Returns
{:ok, %Voxbone.Model.CheckoutCartResponse{}} on success {:error, info} on failure
create_cart(Tesla.Env.client(), keyword()) :: {:ok, Voxbone.Model.CreateCartResponse.t()} | {:error, Tesla.Env.t()}
Allows you to create a cart. The creation of a cart depends on your own business logic, but you'll always need to create at least one cart to place an order (checkoutCart). You can place multiple orders per cart or you can create separate carts for each order. Note that different product types (DID, Capacity or prepaid credits) can be added into one single cart.
Parameters
- connection (Voxbone.Connection): Connection to server
opts (KeywordList): [optional] Optional parameters
- :body (CreateCartRequest):
Returns
{:ok, %Voxbone.Model.CreateCartResponse{}} on success {:error, info} on failure
delete_cart(Tesla.Env.client(), integer(), keyword()) :: {:ok, Voxbone.Model.DeleteCartResponse.t()} | {:error, Tesla.Env.t()}
Allows you to delete a cart and all its content from your list of carts.
Parameters
- connection (Voxbone.Connection): Connection to server
- cart_identifier (integer()): The identifier of the cart.
- opts (KeywordList): [optional] Optional parameters
Returns
{:ok, %Voxbone.Model.DeleteCartResponse{}} on success {:error, info} on failure
get_cart(Tesla.Env.client(), integer(), keyword()) :: {:ok, Voxbone.Model.ListCartResponse.t()} | {:error, Tesla.Env.t()}
Allows you to retrieve your cart attributes (cartIdentifier, customerReference, description) and its content (list of products - orderProducts - that are currently in the cart).
Parameters
- connection (Voxbone.Connection): Connection to server
- cart_identifier (integer()): Identifies the cart and is returned by the createCart method or can be retrieved with the listCart method.
- opts (KeywordList): [optional] Optional parameters
Returns
{:ok, %Voxbone.Model.ListCartResponse{}} on success {:error, info} on failure
list_cart(Tesla.Env.client(), integer(), integer(), keyword()) :: {:ok, Voxbone.Model.ListCartResponse.t()} | {:error, Tesla.Env.t()}
Allows you to list your carts and retrieve their attributes (cartIdentifier, customerReference, description), and their content (list of products - orderProducts - that are currently in the cart).
Parameters
- connection (Voxbone.Connection): Connection to server
- page_number (integer()): The page number, starting at 0.
- page_size (integer()): The page size (max number of entities that are displayed in the response).
opts (KeywordList): [optional] Optional parameters
- :cart_identifier (integer()): Identifies the cart and is returned by the createCart method or can be retrieved with the listCart method.
- :reference (String.t): The reference of the cart.
Returns
{:ok, %Voxbone.Model.ListCartResponse{}} on success {:error, info} on failure
list_order(Tesla.Env.client(), integer(), integer(), keyword()) :: {:ok, Voxbone.Model.ListOrderResponse.t()} | {:error, Tesla.Env.t()}
Allows you to get a list of your orders (after a cart has been checked out) and their status.
Parameters
- connection (Voxbone.Connection): Connection to server
- page_number (integer()): The page number, starting at 0.
- page_size (integer()): The page size (max number of entities that are displayed in the response).
opts (KeywordList): [optional] Optional parameters
- :reference (String.t): The order reference.
- :status (String.t): The status of the order.
- :date_from (String.t): The date from which you want to filter your listed orders based on the timestamp for the order's creation date (dateAdded) in the format YYYY-MM-DD HH:MM:SS
- :date_to (String.t): The date until which you want to filter your listed orders based on the timestamp for the cart's creation date (dateAdded) in the format YYYY-MM-DD HH:MM:SS.
Returns
{:ok, %Voxbone.Model.ListOrderResponse{}} on success {:error, info} on failure
remove_from_cart( Tesla.Env.client(), Voxbone.Model.RemoveFromCartRequest.t(), integer(), integer(), keyword() ) :: {:ok, Voxbone.Model.RemoveFromCartResponse.t()} | {:error, Tesla.Env.t()}
Remove a product from your cart, or change the ordered quantity.
Parameters
- connection (Voxbone.Connection): Connection to server
- body (RemoveFromCartRequest):
- cart_identifier (integer()): The identifier of the cart.
- order_product_id (integer()): The identifier of the product.
- opts (KeywordList): [optional] Optional parameters
Returns
{:ok, %Voxbone.Model.RemoveFromCartResponse{}} on success {:error, info} on failure