Create Cart
curl --request POST \
--url https://sandbox-api.violet.io/v1/checkout/cart \
--header 'Content-Type: application/json' \
--data '{
"base_currency": "<string>",
"skus": [
{
"id": 123,
"merchant_id": 123,
"app_id": 123,
"product_id": "<string>",
"sku_id": 123,
"external_id": "<string>",
"name": "<string>",
"brand": "<string>",
"thumbnail": "<string>",
"quantity": 123,
"price": 123,
"weight": 123,
"height": 123,
"width": 123,
"length": 123,
"available": true,
"status": "IN_PROGRESS",
"product_type": "PHYSICAL",
"quantity_fulfilled": 123,
"order_sku_rates": [],
"transient_external_product_id": "<string>"
}
],
"referral_id": "<string>",
"app_order_id": "<string>",
"customer": {
"user_id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"external_id": "<string>",
"shipping_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"billing_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"same_address": true,
"name": "<string>"
},
"discounts": [
{
"code": "<string>",
"merchant_id": 123
}
],
"wallet_based_checkout": true
}'
{
"id": 123,
"token": "<string>",
"user_id": 123,
"app_id": 123,
"developer_id": 123,
"customer": {
"user_id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"external_id": "<string>",
"shipping_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"billing_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"same_address": true,
"name": "<string>"
},
"bags": [
{
"id": 123,
"order_id": 123,
"merchant_id": 123,
"app_id": 123,
"external_id": "<string>",
"status": "IN_PROGRESS",
"fulfillment_status": "PROCESSING",
"financial_status": "UNPAID",
"skus": [],
"shipping_method": {
"price": 123,
"shipping_method_id": "<string>",
"bag_id": 123,
"merchant_id": 123
},
"taxes": [],
"sub_total": 123,
"shipping_total": 123,
"tax_total": 123,
"discount_total": 123,
"total": 123,
"taxes_included": true,
"transactions": [],
"external_checkout": true,
"commission_rate": 123,
"date_created": "2023-11-07T05:31:56Z",
"remorse_period_ends": "2023-11-07T05:31:56Z",
"currency": "<string>",
"external_currency": "<string>",
"currency_exchange_rate": 123,
"channel": "APP",
"app_order_id": "<string>",
"platform": "OTHER",
"fulfillments": [],
"discounts": [],
"wallet_based_checkout": true,
"app_name": "<string>",
"bag_id": 123,
"bag_status": "IN_PROGRESS",
"merchant_name": "<string>"
}
],
"shipping_address": {
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"phone": "<string>",
"type": "shipping",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"billing_address": {
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"phone": "<string>",
"type": "shipping",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"payment_method": {
"brand": "<string>",
"last_four": "<string>",
"exp_month": 123,
"exp_year": 123,
"cardholder_name": "<string>",
"payment_method_id": 123,
"default": true
},
"sub_total": 123,
"shipping_total": 123,
"tax_total": 123,
"discount_total": 123,
"total": 123,
"app_customer_id": "<string>",
"app_order_id": "<string>",
"status": "in_progress",
"is_guest": true,
"date_created": "2023-11-07T05:31:56Z",
"date_last_modified": "2023-11-07T05:31:56Z",
"priced": true,
"wallet_based_checkout": true,
"currency": "<string>",
"referral_id": "<string>",
"errors": [
{
"id": 123,
"order_id": 123,
"bag_id": 123,
"entity_id": "<string>",
"type": "EXTERNAL_CREATE_CART",
"message": "<string>",
"date_created": "2023-11-07T05:31:56Z",
"platform": "OTHER"
}
],
"currency_symbol": "<string>",
"app_name": "<string>",
"stripe_key": "<string>",
"payment_intent_client_secret": "<string>",
"guest": true,
"order_status": "IN_PROGRESS",
"intent_based_checkout": true,
"order_id": 123
}
Note: For more details on this endpoint please refer to the the API Reference
Cart creation begins the checkout process. Products can be added to the cart at creation with a JSON Body listing 1 or more sku_id & quantity pairs.
It is not required that you add a SKU to create a cart, since it is possible for your customers cart to be empty, however, in this example, we will purchase a product with the SKU 10064 (which we noted down from the previous section)
Headers
Query Parameters
APP
, MARKETPLACE
, FACEBOOK
, INSTAGRAM
, WALMART
, GOOGLE
, TIKTOK
, SNAPCHAT
, PINTEREST
Body
Base currency of cart
Optional collection of SKUs
Associate the order with a user or affiliate in your system
Map the order in Violet to an order record within your system
The Customer Placing the Order
Optional collection of Discounts
Boolean denoting whether or not this order will be placed through a wallet based payment mechanism such as apple pay
Response
ID of the User placing the order
ID of the App creating the order
ID of the Developer who placed
The Customer Placing the Order
Bags in the Order
The shipping or billing address of a user placing an order
The shipping or billing address of a user placing an order
Payment Method belonging to an Order
Subtotal of the Order
Shipping Total of the Order
Tax Total of the Order
Discount Total of the Order
Total of the Order
App Customer ID
App Order ID
Status of the Order
in_progress
, processing
, completed
, canceled
, partially_refunded
, refunded
, requires_action
Order is Guest
Date of order creation
Date of last order update
Is the cart priced
Is this cart going to be placed through wallet-based checkout
Base currency of cart
Optional value used to represent an identifier in your system.
Errors on the Order
Symbol representing the desired currency
Name of app that originated the order.
Stripe publishable key. Use for tokenizing payment methods.
Payment intent client secret
IN_PROGRESS
, PROCESSING
, COMPLETED
, CANCELED
, PARTIALLY_REFUNDED
, REFUNDED
, REQUIRES_ACTION
Was this page helpful?
curl --request POST \
--url https://sandbox-api.violet.io/v1/checkout/cart \
--header 'Content-Type: application/json' \
--data '{
"base_currency": "<string>",
"skus": [
{
"id": 123,
"merchant_id": 123,
"app_id": 123,
"product_id": "<string>",
"sku_id": 123,
"external_id": "<string>",
"name": "<string>",
"brand": "<string>",
"thumbnail": "<string>",
"quantity": 123,
"price": 123,
"weight": 123,
"height": 123,
"width": 123,
"length": 123,
"available": true,
"status": "IN_PROGRESS",
"product_type": "PHYSICAL",
"quantity_fulfilled": 123,
"order_sku_rates": [],
"transient_external_product_id": "<string>"
}
],
"referral_id": "<string>",
"app_order_id": "<string>",
"customer": {
"user_id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"external_id": "<string>",
"shipping_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"billing_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"same_address": true,
"name": "<string>"
},
"discounts": [
{
"code": "<string>",
"merchant_id": 123
}
],
"wallet_based_checkout": true
}'
{
"id": 123,
"token": "<string>",
"user_id": 123,
"app_id": 123,
"developer_id": 123,
"customer": {
"user_id": 123,
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"external_id": "<string>",
"shipping_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"billing_address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"type": "shipping",
"address_1": "<string>"
},
"same_address": true,
"name": "<string>"
},
"bags": [
{
"id": 123,
"order_id": 123,
"merchant_id": 123,
"app_id": 123,
"external_id": "<string>",
"status": "IN_PROGRESS",
"fulfillment_status": "PROCESSING",
"financial_status": "UNPAID",
"skus": [],
"shipping_method": {
"price": 123,
"shipping_method_id": "<string>",
"bag_id": 123,
"merchant_id": 123
},
"taxes": [],
"sub_total": 123,
"shipping_total": 123,
"tax_total": 123,
"discount_total": 123,
"total": 123,
"taxes_included": true,
"transactions": [],
"external_checkout": true,
"commission_rate": 123,
"date_created": "2023-11-07T05:31:56Z",
"remorse_period_ends": "2023-11-07T05:31:56Z",
"currency": "<string>",
"external_currency": "<string>",
"currency_exchange_rate": 123,
"channel": "APP",
"app_order_id": "<string>",
"platform": "OTHER",
"fulfillments": [],
"discounts": [],
"wallet_based_checkout": true,
"app_name": "<string>",
"bag_id": 123,
"bag_status": "IN_PROGRESS",
"merchant_name": "<string>"
}
],
"shipping_address": {
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"phone": "<string>",
"type": "shipping",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"billing_address": {
"name": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"phone": "<string>",
"type": "shipping",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"payment_method": {
"brand": "<string>",
"last_four": "<string>",
"exp_month": 123,
"exp_year": 123,
"cardholder_name": "<string>",
"payment_method_id": 123,
"default": true
},
"sub_total": 123,
"shipping_total": 123,
"tax_total": 123,
"discount_total": 123,
"total": 123,
"app_customer_id": "<string>",
"app_order_id": "<string>",
"status": "in_progress",
"is_guest": true,
"date_created": "2023-11-07T05:31:56Z",
"date_last_modified": "2023-11-07T05:31:56Z",
"priced": true,
"wallet_based_checkout": true,
"currency": "<string>",
"referral_id": "<string>",
"errors": [
{
"id": 123,
"order_id": 123,
"bag_id": 123,
"entity_id": "<string>",
"type": "EXTERNAL_CREATE_CART",
"message": "<string>",
"date_created": "2023-11-07T05:31:56Z",
"platform": "OTHER"
}
],
"currency_symbol": "<string>",
"app_name": "<string>",
"stripe_key": "<string>",
"payment_intent_client_secret": "<string>",
"guest": true,
"order_status": "IN_PROGRESS",
"intent_based_checkout": true,
"order_id": 123
}