ShopBase Developers
  • Getting started
  • Build An App
    • Making your first request
      • Authentication
        • Public apps
        • Private apps
        • OAuth
        • API access scopes
      • Rest API References
        • Rate limits
      • Using webhooks
        • Webhook events and topics
      • Response status codes
    • How to submit an app to ShopBase App Store
    • Getting your app approved
      • App requirements
      • Testing your app
      • Submitting your app
      • The review process
  • BUILD A THEME
    • Getting started building themes
    • Theme development resources
      • Connect to your store & start developing
      • Theme structure
      • Theme object, methods, and props
      • Theme editor
        • How to update configure for theme editor
    • How to submit a theme to ShopBase Theme Store
    • Storefront SDK
  • Test and Debug app
    • Debug apps with Postman
  • Tutorial
    • Manage orders and shipping
      • Manage orders with the REST Admin API
        • Transaction
        • Order
      • Edit an existing order with the Admin API
      • Manage fulfillments with Fulfillment and FulfillmentService resources
      • Get a country field using Admin API
  • Integrate a payment gateway
    • How to create your payment gateway on ShopBase
    • Technical Specifications
Powered by GitBook
On this page
  • Get your ShopBase API credentials
  • Add API credentials to an endpoint URL
  • Generate code snippet for API support
  • Creating Postman collections
  • Adding calls to Postman collections
  • Next steps

Was this helpful?

  1. Test and Debug app

Debug apps with Postman

PreviousStorefront SDKNextManage orders and shipping

Last updated 4 years ago

Was this helpful?

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

Get your ShopBase API credentials

To make authorized requests to the ShopBase API from Postman, you need to

The scopes you grant when generating your API credentials will give Postman the equivalent permissions. Proceed with caution when granting write access.

Step 1: To generate private API credentials, create a private app:

Consider skipping this part if you are already familiar with the content.

Step 2: Send your API Credentials into Postman's New Tab :

  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.

CAUTION

Don't enter the shared secret in place of the API password

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-names> is the name of your store:

    https://{store-names}.onshopbase.com/admin/shop.json

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-name> is the domain of your store:

https://apikey:password@<store-name>.onshopbase.com/admin/shop.json

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

Generate code snippet for API support

Whenever you need support with your API call, you can contact our support team and send us the CURL request using the below instruction.

Please create a new private app or generate a new private key once the support process is done to ensure the security of your app.

  1. Create the API request with Postman (Step 2: Send your API Credentials into Postman's New Tab in Get your ShopBase API credentials)

  2. Select Code (</>) button on the top right.

  3. Select cURL (Code Generation Settings).

  4. Use the copy button and send the code to ShopBase Support.

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.

TIP

Adding calls to Postman collections

After you've created a collection, you can add calls to help organize your 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:

  6. Click Body.

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

  8. Scroll down to the Create a new product POST call and copy the JSON of the IPod Nano - White, 8GB product.

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

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

NOTE

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

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

Looking for a quick start? You can find details about all supported APIs in the .

In your browser, go to the

Shopbase prevents HTTP Basic Auth POST requests that have cookies, which can cause POST calls to fail. If your POST call fails, then you should try .

Browse the to learn about collections and other features in more detail. You can also use Postman to help you .

Admin API reference
Product reference
clearing your cookies
Postman documentation
build a public ShopBase app
Postman
generate private API credentials