This tutorial is the final post in a set of three to help you get up and running with Moltin via Postman.
In the last Postman tutorial, we created our first Tax Band, Category, and finally, our first Product!
In this one, we’ll add a Product to a Cart, convert the Cart to Checkout, and create an Order. We’ll also need to cover some Shipping and Gateways.
This is a good point to mention - if you haven’t completed QuickStart #1 yet, go back and do so before proceeding. You can find it here.
We’ll presume at this stage, you have your Postman collection and environment set up with a Bearer token, tax_band_id, category_id & product_id.
Step 1: Open the Quickstart #2 folder on the left-hand menu of Postman.
Step 2: If it’s been more than an hour since you completed the last tutorial, rerun the ‘Create a Bearer token’ request, and paste the new access token back into the bearer value in the environment by hitting cmd+e on mac to open, and clicking on ‘Moltin V1’.
Step 3: Open and send the ‘Create a New Customer’ request. In the response, copy the ID. Paste this ID into the Environment for the value of customer_id.
Step 4: Open the ‘Add a Product to Cart’ request and send it. This will populate with the product and customer we created in the previous post. No need to note anything here, just move on to Step 5.
Step 5: Send the ‘Create a Shipping Method’ request, it’s something we need for checkout. Copy the resulting ID into the environment as the value for shipping_id.
Step 6: Send the ‘Enable a Gateway’ request. Again, this is something we need for Checkout. No need to note anything here either, as we’re specifying the Gateway explicitly at Checkout.
Step 7: Send the ‘Convert Cart into an Order’ request. The response will come back with the status of
true, and you’ll have a new order! Copy the Order ID, and paste it into the Environment as the value for order_id
Step 8; Send the ‘Update an Order status to Paid’ request.
- Because we used the dummy payment gateway, we’re not handling any live payments, so you don’t need to worry about entering actual payment details.
- Let’s assume that upon order creation, you sent a redirect to your own gateway where payment was processed.
- Once we get a webhook for that completing, we’ll need to mark the order as paid.
- We’ll cover this process in detail with a follow-on post.
That’s it! You’ve now completed Product -> Cart -> Checkout -> Order (unpaid) -> Order (paid)