Create a Cart
Cart creation begins the checkout process. An empty cart with no products can be created, or a cart prefilled with items can be created for your shopper.
POST /checkout/cart
Intialize an empty cart or pass in a list of SKUs to generate a pre-filled cart. API Reference: Create Cart
Request
Cart creation takes the following optional parameters:
Intializes your cart with the provided base currency. By default a cart is created in USD.
A list of SKUs for the products you want to initialize the cart with
Cart creation takes the following optional query parameters:
This parameter lets you map the order in Violet to an existing order record within your system.
A string that can be passed in to track referrals and map them to id’s in your system.
Response
Currency Considerations
When creating a cart, if you pass in the base_currency
query parameter the currency
in the Cart object will match what was passed in, this is also the currency that the shopper will pay in. The default currency when no parameter is provided is USD.
All the bags on the order will be converted to the currency
on the Cart at the time of Cart submission. When looking at the Bag object you will see currency
and external_currency
. The currency
will match the Order currency
, while the external_currency
is what the merchant has their currency set to on their e-commerce store.
The exchange rate is calculated as external_currency → currency. The exchange rate is then applied to all amounts so they reflect currency
.
As an example, on a Bag, if the external_currency
is USD and the currency
is GBP the exchange_rate
would be ~ 0.85 which each of the totals would be multiplied by. So if the external item was 85 to reflect GBP on the cart.
Was this page helpful?