Fetching resources

How to fetch single resources or collections

You can fetch either single resources or collections by sending GET requests to the resource endpoints.

The Accept header must be application/vnd.api+json.

pageAuthentication

Examples

Fetching a single SKU

The following request fetches a single SKU, the one identified by the ID "xYZkjABcde":

curl -g -X GET \
  'https://yourdomain.commercelayer.io/api/skus/xYZkjABcde' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' 

Fetching a collection of SKUs

The following request fetches a collection of SKUs:

curl -g -X GET \
  'https://yourdomain.commercelayer.io/api/skus' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' 

When fetching SKUs with a market in scope only the SKUs that are sellable in that market are returned. To be sellable in a market an SKU must have a price in the market's price list and at least one stock item in one of the market's stock locations, regardless of its quantity.

Last updated