This tutorial follows on from our introductory post and will help you programmatically create your first product via the Moltin API, using Postman.

There are a few things we need to set up first though, so let’s jump in!

Step 1: In Postman, hit cmd and e together (mac only), this will open up your “Manage Environments” window. Click on ‘Moltin V1’.

Step 2: Add your Moltin Client ID & Secret in the respective values and click Update, then close the window. (You can find your Moltin credentials here).

Step 3; Go to the ‘QuickStart #1’ folder in the Moltin Postman collection.

Step 4: Open the ‘Create a Bearer token’ request and hit the blue ‘Send’ button to run it. This will authenticate, you’ll see something called “access-token” in the response. Copy the access token value, but make sure not to include the quotes.

Step 5: Back in ‘Manage Environments’ (cmd+e on mac), paste what you copied into the ‘Bearer’ value - then hit Update. Bear in mind (pun intended) that the token will only last for an hour, but that’s enough for this tutorial. Close the window.

Step 6: From the Quickstart #1 folder, open and send the “Create a Tax Band’ request. Look at the response, and copy the ID value. Paste this ID into the Environment for the value of tax_band_id, hit update and close the window.

Step 7: Open and send the ‘Create a New Category’ request. In the response, copy the category ID. Paste this ID into the Environment for the value of category_id. Update and close.

Step 8: Open and run the ‘Create a new Product’ request. In the response, copy the Product ID. Paste this ID into the Environment for the value of product_id. Update and close.

Step 9: You now have a Product, with an associated Tax Band and Category. We’ve recorded the ID for each of these in the environment so that we can use them in the next tutorial automatically.

Nailed

Onward! Click on the second guide below to create some more awesomeness.

Quickstart #2 - shipping, cart checkout, order.

Matt Foyle

Written by Matt Foyle - Customer Success @ Moltin