Using Postman

Postman is an OSX application that lets you send HTTP requests to Shopify API endpoints. It can be a useful tool for getting started with the Shopify API or for debugging your apps.

Get your Shopify API credentials

To make authorized requests to the Shopify API from Postman, you need to generate private API credentials.

Sending requests to Shopify with Postman

In Postman, you need to create a tab to make a request to the Shopify API. You can use multiple tabs to create multiple API requests.

A new tab in Postman

To create an authorized request:

  1. Click + to create a new tab.
  2. Click Authorization.
  3. From the Type drop-down menu, select Basic auth.
  4. In the Username and Password fields, enter your store's private API key and password respectively.

After you've authenticated your request, you need to specify the applicable HTTP method and API endpoint URL before you can send it. For example, you can use Postman to retrieve your store information:

  1. From the request method drop-down menu, select GET.
  2. Enter the store API endpoint, where <@store_url> is the domain of your store:

    https://<@store_url>/admin/shop.json

    Entering store information in a new Postman tab

  3. Click Send.

If the request was formatted correctly, then the store information is returned:

{
  "shop": {
    "id": 4159229,
    "name": "John's Apparel",
    "email": "johns-apparel@gmail.com",
    "domain": "johns-apparel.com",
    "created_at": "2014-03-27T17:52:33-04:00",
    "province": "Ontario",
    "country": "CA",
    "address1": "150 Elgin St.",
    "zip": "K2P1L4",
...
  }
}

Add API credentials to an endpoint URL

Instead of entering your credentials in the Authorization section of Postman, you can paste a URL that includes your API key and password directly into the URL bar. The format of the URL is as follows, where <@store_url> is the domain of your store:

https://apikey:password@<@store_url>/admin/shop.json

When you click Send, the data is returned to Postman in the body of the response.

Creating Postman collections

After you've successfully sent an API request with Postman, you can save it into a collection. Collections group together related API calls and are a great way to organize your work in Postman.

To save an API request to a collection:

  1. In the tab for the API call you've just sent, click the arrow next to Save.
  2. Click Save As, then enter a Request name. You can also enter an optional description for the request.
  3. Click Create collection.
  4. Enter a name for your collection, then click the checkmark.
  5. Select the name of your collection.
  6. Click Save to (Name of your collection).

You can access your saved collections from the Collections tab in the sidebar.

Adding calls to Postman collections

After you've created a collection, you can add calls to help organize your Shopify API calls. For this example, you'll add a call that posts a product to your store.

To create a call and add it to your collection:

  1. Click + to open a new tab.
  2. From the Type drop-down menu, select Basic Auth.
  3. In the Username and Password fields, enter your store's private API key and password respectively.

  4. From the API actions drop-down menu, select POST.

  5. Enter the API endpoint for adding a product, where <@store_url> is the URL of your store:

    https://<@store_url>/admin/products.json
  6. Click Body.

  7. Select raw, then in the drop-down menu, select JSON (application/json).

  8. In your browser, go to the Product reference.

  9. Scroll down to the Create a new product POST call and copy the JSON of the Burton Custom Freestyle product.

  10. Paste the JSON in the Body of your Postman request.

    The Body of the Postman request

  11. Click Send. If the request is properly formatted, then the product response JSON will be returned to Postman.

    Also note that the request headers automatically update to include Content-Type:application/json:

    The headers of a Postman request including the Content-Type

  12. After the call has sent successfully, click the arrow next to Save.

  13. Select the name of your collection.

  14. Click Save to (Name of your collection).

You can add as many API calls to a collection as you want. You can access your saved collections from the Collections tab in the sidebar.

Next steps

Browse the Postman documentation to learn about collections and other features in more detail. You can also use Postman to help you build a public Shopify app.

Sign up for a Partner account to get started.

Sign up