You can also follow this guide in Postman under recipes by using the appropriate requests and environment variables for the headers.
So far you have been able to view all the Merchants available for your application, view their catalog of products and select one specific product. Here you will learn how to go through the entire flow of purchasing a product through Violet. To get started with the Checkout process, we will create a cart and add products to it. For this section, we have taken the SKU that we retrieved details for in Interact with Catalogs.
Currently Violet passes all failures in checkout relating to surpassing rate limits downstream. When integrating with Violet you must consider and prepare for such scenarios in all API calls to Violet. Handling rate limits with Violet
An cart response can come back with status code
200 and still have errors in the
errors field. This is because there might only be errors on some of the SKUs or Bags while the rest of the order is in a good state.
Make sure your system is coded to always check for the presence of the
errors field on responses, no matter the status code.
We will now imagine we are a shopper, P. Sherman living on 42 Wallaby Way, Sydney, actually purchasing this product through your Application using Violet.
As seen above, the cart has now been created with the product of our choosing (SKU: 10064, GoPro Quadcopter). You may be wondering what a “bag” is in the response — since Violet let’s you sell products across different Merchants, during the checkout process we bucket each Merchant’s products together in “Bags”. Bags are automatically created and managed by Violet.
Now that the cart is created and the customer is ready to start the checkout process, the next steps is collecting customer information and applying it to the cart. Save the Cart Id from the Create Cart response. In the example above, this is
Apply Customer Info
With the customer info applied we can go onto getting the shipping methods for each bag within the cart. Our test cart here only has one bag.
Get Shipping Method
Choose your shipping method and apply it!
Apply Shipping Method
Now that shipping address, billing address and shipping method have all been taken care of, we can move onto payments. Here you’ll be able to show your customer the final order for review and enter their payment information. You can read more about how payments work in Violet here Payments.
The response above is our final order and gives your customer the chance to review their cart, along with shipping information, payment information and product details. Notice how all the fields have now been populated, including credit card details. To confirm this order, all that’s left is to Submit the cart!
And you’re done! You have now successfully placed an order through Violet and have a happy customer, all without having to integrate with any downstream merchant yourself. Your customer will now receive their purchase directly from the merchants and all payments to both you and the merchant will be handled for you by Violet. You can see the details of this sale on your Channel Dashboard (channel.violet.io).
Although we’ve done a lot already, this is only the start to what Violet can offer your application. We also have to provide shipping updates; browsing through product categories to better showcase which products are available to buy; and Violet Connect, a simple wizard that lets you directly add any new merchant to your application. For a complete list of APIs we have to offer and more information on the ones you’ve interacted with, please refer to our API Reference pages.
You can also read more about Violet on our Blog or Send us an email to get a demo or learn more about how we can work together!