Skip to content
DocsGetting started

Quickstart

Make your first authenticated request to the Sellforge product API.

This walkthrough reads your product catalog without changing shop data.

Before you begin

You need access to a Sellforge shop, its shop-admin API URL, and an API token with the catalog:read scope. Create the token from the shop admin's API token settings. Its plaintext value is shown once.

For a local shop-admin backend, the usual base URL is http://localhost:9201. Use your deployment's configured URL when connecting to a hosted environment.

Configure your environment

Set the base URL in your terminal and read your token without including it in shell history:

bash
export SELLFORGE_ADMIN_URL='http://localhost:9201'
read -r -s -p 'API token: ' SELLFORGE_API_TOKEN
export SELLFORGE_API_TOKEN

The secret token starts with sfk_. This is different from the pk_sf_ publishable key used by storefronts.

Make a request

bash
curl --fail-with-body \
  "$SELLFORGE_ADMIN_URL/api/admin/products?limit=10" \
  -H "Authorization: Bearer $SELLFORGE_API_TOKEN"

The response contains a products array and pagination metadata. For an empty catalog, a valid response is:

json
{
  "products": [],
  "count": 0,
  "limit": 10,
  "offset": 0
}

Fetch the next page

Increase offset by the page size to retrieve the next page:

bash
curl --fail-with-body \
  "$SELLFORGE_ADMIN_URL/api/admin/products?limit=10&offset=10" \
  -H "Authorization: Bearer $SELLFORGE_API_TOKEN"

Read the resource's pagination notes before implementing a complete export. Channel-restricted users can receive fewer product entries than the requested limit.

Troubleshoot a request

ResponseCheck
401The token is present, valid, and not expired or revoked
403The token includes catalog:read and its creator still has the required permissions
404You are calling the shop-admin backend and the resource belongs to your shop
Empty productsYour shop has visible products matching the supplied filters

Continue with Products for filters and product fields, or Authentication for the different credential types.

Source reviewed Checked against kernel fe5c475.

Found something unclear? Let us know

Start exploring

NavigateOpenEscClose