Skip to content

Quickstart

This page takes you from an empty terminal to a listing created through the Admin API. You need a marketplace you administer. If you do not have one yet, start a free trial first: it takes a minute.

The examples use the fictional marketplace acme.mykreezalid.com. Replace it with your own address everywhere.

  1. Sign in to the back office of your marketplace, https://acme.mykreezalid.com/admin.

  2. Open Settings → Account (/admin/settings/account) and find the API access section.

  3. Click Generate secret key. The page now shows an API key (it starts with pk_) and an API secret (it starts with sk_).

  4. Store both values in your secret manager or in environment variables. The examples below read them from KREEZALID_API_KEY and KREEZALID_API_SECRET.

Terminal window
export KREEZALID_BASE_URL="https://acme.mykreezalid.com/api/v1"
export KREEZALID_API_KEY="pk_…"
export KREEZALID_API_SECRET="sk_…"

The Admin API uses HTTP Basic authentication: the API key is the user name, the API secret is the password. List the categories of your marketplace; you need a category id to create a listing anyway.

Terminal window
curl "$KREEZALID_BASE_URL/listings/categories" \
-u "$KREEZALID_API_KEY:$KREEZALID_API_SECRET"

A successful call answers 200 with the categories and a pagination block:

{
"categories": [
{
"id": 812,
"title": "Road bikes",
"page_title": "Second-hand road bikes",
"description": "Carbon and steel road bikes, checked by our partners.",
"slug": "road-bikes",
"listing_count": 37,
"url": "https://acme.mykreezalid.com/…",
"admin_url": "https://acme.mykreezalid.com/admin/…"
}
],
"pagination": {
"totalResultsCount": 1,
"currentPage": 1,
"nextPage": false,
"prevPage": false,
"resultOnPageCount": 1,
"pageCount": 1
}
}

If you get a 403 instead, read the message: Access denied. Please use your API credentials to use the API means no credentials were sent, Permission denied, wrong credentials means the pair is wrong or belongs to another marketplace. See Errors.

3. Find the vendor who will own the listing

Section titled “3. Find the vendor who will own the listing”

Every listing belongs to a user, its vendor. List your users and pick one whose group allows posting listings (can_post_listing: true):

Terminal window
curl "$KREEZALID_BASE_URL/users?fields=id,email,public_name,group,can_post_listing&limit=5" \
-u "$KREEZALID_API_KEY:$KREEZALID_API_SECRET"
{
"users": [
{
"id": 4242,
"email": "jane@example.com",
"public_name": "Jane's Cycles",
"group": { "object": "Group", "id": 3, "name": "Vendors", "alias": "vendors" },
"can_post_listing": true
}
],
"pagination": { "totalResultsCount": 18, "currentPage": 1, "nextPage": true, "prevPage": false, "resultOnPageCount": 5, "pageCount": 4 }
}

Send POST /api/v1/listings with a JSON body. user_id, title, description, price and category_id are required.

Terminal window
curl -X POST "$KREEZALID_BASE_URL/listings" \
-u "$KREEZALID_API_KEY:$KREEZALID_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"user_id": 4242,
"category_id": 812,
"title": "Steel road bike, 56 cm",
"description": "Reynolds 531 frame, serviced in September. Ready to ride.",
"price": 480,
"quantity": 1,
"external_id": "JC-BIKE-0193",
"images": ["https://images.example.com/bikes/0193-side.jpg"]
}'

The response gives the id of the new listing:

{
"id": 645646,
"message": "Listing created",
"success": true
}

A few behaviours worth knowing before you go further:

  • The listing is published and approved right away. To create it offline, send "is_online": 0: it is saved as a draft and blocked, and you publish it later.
  • description is stored as plain text. HTML you send is converted to text.
  • Each URL in images is downloaded during the request, so it only needs to be reachable for that long. The array order is the display order.
  • A price of 0 is refused as missing.
Terminal window
curl "$KREEZALID_BASE_URL/listings/645646" \
-u "$KREEZALID_API_KEY:$KREEZALID_API_SECRET"

A single listing comes back under the product key:

{
"product": {
"object": "Listing",
"id": 645646,
"title": "Steel road bike, 56 cm",
"status": "published",
"admin_status": "approved",
"visibility": "both",
"price": "480.00",
"price_with_currency": "€480.00",
"currency": "EUR",
"quantity": 1,
"external_id": "JC-BIKE-0193",
"category": { "object": "Category", "id": 812, "title": "Road bikes", "slug": "road-bikes" },
"owner": { "object": "User", "id": 4242, "public_name": "Jane's Cycles" },
"medias": [
{ "object": "Media", "id": 99120, "alt": null, "position": 0, "media_type": "image", "src": "https://…/0193-side.jpg" }
],
"url": "https://acme.mykreezalid.com/…"
}
}

This response is abridged: the full listing also carries its attributes, variants, add-ons, shipping methods, order type and metafields. Amounts such as price are returned as strings with two decimals. See Retrieve listing for every field.