Changelog

Consolidated Checkout Endpoints

Multiple endpoints in the checkout process have been consolidated to reduce the number of requests required to complete an order. Usage of these consolidations is optional, the original iterative endpoints will continue to be operational.

Create Initialized Cart

Carts can now be created with initialized data. This is primarily useful for adding items to your cart on creation.

curl -X POST https://sandbox-api.violet.io/v1/checkout/cart \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"base_currency": "USD", "skus": [{"sku_id": 999, "quantity": 1}]}'

Apply Customer with Addresses

Complete customer data can now be applied in a single request. This removes the need to add the shipping and billing addresses in separate requests.

Optional Body Parameters:

shipping_address - the shipping address of the customer.
billing_address - the billing address of the customer.
same_address - use same address for both.

curl -X POST https://sandbox-api.violet.io/v1/checkout/cart/{cart_id}/customer \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"first_name":"Ultra","last_name":"Violet","email":"[email protected]","shipping_address":{"address_1":"12345 Street Address","city":"Seattle","state":"WA","country":"US","postal_code":"98121","type":"SHIPPING","first_name":"Ultra","last_name":"Violet","name":"Ultra Violet"},"same_address":true}'

Complete Checkout on Successful Payment

Checkouts can now be completed upon successful payment. This removes the need to perform the cart submission request.

Optional Body Parameters:

complete_checkout - submit cart on successful payment authorization.

curl -X POST https://sandbox-api.violet.io/v1/checkout/cart/{cart_id}/payment \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"card_number": "4242424242424242", "card_cvc": 111, "card_exp_month": 12, "card_exp_year": 2022, "complete_checkout": true}'