Get Started

Getting started with the REST Admin APIs

The REST Admin APIs let you build apps and other integrations for the Shoplazza admin using REST. With the APIs, you can create apps that offer functionality at every stage of a store's operation, including metafield and product management.

Authentication

The REST Admin APIs require a Shoplazza access token for making authenticated requests.

Authenticate using OAuth

To get the access token, follow the OAuth authorization flow in the OAuth guide. Include the access token as a Access-Token header in your requests.

You can obtain an access token by following the OAuth authorization process.

REST Admin API

You can access the REST Admin API using curl or any other HTTP client. REST Admin API endpoints are organized by APIs References. You'll need to use different API endpoints depending on the service that your app provides.

Example GET request using curl

The following curl request retrieves information by using the Collection API and the GET /openapi/2022-01/collections endpoint. Replace {shop} with your store’s domain and {token} with the access token you generated in the Authentication section.

Request:

curl -X GET \
  https://{shop}.myshoplazza.com/openapi/2022-01/collections \
  -H 'Content-Type: application/json' \
  -H 'Access-Token: {token}'

Example POST request

The following example illustrates how to create a product by using the Product API and the POST /openapi/2022-01/products endpoint. Replace {shop} with your store’s domain and {token} with the access token you generated in the Authentication section.

Request:
POST https://{shop}.myshoplazza.com/openapi/2022-01/products

{
     "product": {
       "title": "Hipop T-Shirts",
       "brief": "Good product!",
       "published": "false",
       "requires_shipping": "false",
       "inventory_tracking": "false",
       "display_fake_sales": "false"
     }
}

Example PUT request

The following example illustrates how to update the postal code of a customer address by using the Collection API and the PUT /openapi/2022-01/collections/{id} endpoint.

Request:
PUT /openapi/2022-01/collections/123

{
     "collection": {
          "title": "asd",
          "handle": "asd",
          "meta_title": "asd",
          "meta_description": "asd",
          "meta_keyword": "asd",
          "description": "asd",
          "sort_order": "alpha-desc"
     }
}

Example DELETE request

The following example illustrates how to delete an order by using the Collection API and the DELETE /openapi/2022-01/collections/{id} endpoint.

Request:
DELETE /openapi/2022-01/collections/123