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.
Intialize an empty cart or pass in a list of SKUs to generate a pre-filled cart. API Reference: Create Cart
Cart creation takes the following optional parameters:
base_currency - Intializes your cart with the provided base currency. By default a cart is created in USD.
skus - A list of SKUs for the products you want to initialize the cart with
Cart creation takes the following optional query parameters:
app_order_id - This parameter lets you map the order in Violet to an existing order record within your system.
referral_id - A string that can be passed in to track referrals and map them to id's in your system.
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 $100 in the merchants currency of USD the total would be converted to $85 to reflect GBP on the cart.