CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

freshstore/freshstore-site-api

Safely read and change a FreshStore affiliate site through its Site API, covering products, articles, redirects, click analytics and product feeds.

Quality

86%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

products.mdreferences/

Products and offers

A product is the page. An offer is a merchant link with a price, attached to one or more products. A product with no offer has no price, no buy button and no image from a merchant.

Scopes: products for products, offers for offers, categories:read to look up category ids.

List and find

fsapi GET "/products?search=headphones&per_page=50"
fsapi GET "/products?enabled=false&sort_by=updated_at&sort_dir=desc"
fsapi GET "/products/41?include=brand,offers,categories"

Filters: search (title), enabled, brand_id, category_id, tag_id, own_touch=with|without (products with or without the owner's own verdict, pros, cons or photo). sort_by is one of id, title, slug, enabled, brand_id, analytics_visits, review_score, review_quantity, author_rating, created_at, updated_at. include is one comma-separated string, not an array.

Categories: fsapi GET /categories/tree (all, nested) or fsapi GET "/categories?search=kitchen". If a name matches none or several, ask the user.

Add Amazon products (easiest)

The site fetches title, images and price in the background and writes each product's content with AI, which uses AI chips. Confirm with the user before importing more than one link.

fsapi POST /products/import-links -d '{
  "links": ["https://www.amazon.com/dp/B0EXAMPLE1", "B0EXAMPLE2"],
  "categories": [12],
  "locale": "us"
}'

Up to 100 links, ASINs or pasted text per call. Returns 202 with a status per link: importing, duplicate (with the existing product_id) or failed (with a reason). locale is the marketplace for bare ASINs (default us). Check the new products a few minutes later with GET /products?sort_by=created_at.

Add a product by hand (any merchant)

Three or four calls. Confirm the plan with the user first.

# 1. The product page
fsapi POST /products -d '{"title":"Example Headphones","summary":"Closed-back studio headphones.","enabled":true}'
# -> 201, data.id = 101

# 2. The offer (merchant is amazon, ebay, etsy, walmart, aliexpress or custom)
fsapi POST /offers -d '{
  "merchant":"custom","title":"Example Headphones","url_detail":"https://merchant.example/p/123?aff=me",
  "merchant_offer_id":"123","price":129.00,"currency":"USD","stock_available":true,"images":["https://merchant.example/img/123.jpg"]
}'
# -> 201, data.id = 555

# 3. Link the offer (adds; never removes existing links)
fsapi POST /offers/555/products -d '{"product_ids":[101]}'

# 4. Categories (REPLACES the product's whole list: read it first)
fsapi GET /products/101/categories
fsapi POST /products/101/categories -d '{"category_ids":[12]}'

merchant_offer_id is required: for custom, use the merchant's own item id or SKU. A custom offer gets nothing fetched, so ask the user for the title, price, currency and an image URL.

For a merchant other than custom, the site keeps one offer per merchant, locale and item, and fetches price, stock and images itself. Creating one that exists returns the existing offer.

Import from a CSV

fsapi POST /products/import-csv -d '{"csv_url":"https://example.com/products.csv","enabled":false}'
fsapi GET /products/import-csv/{id}

Or send the file as multipart file (drop the JSON Content-Type header for that call). Up to 5 MB and 1,000 rows. Only a title column is required; a url column makes the affiliate offer. Rows with no url import hidden. Set generate_content only after the user agrees to spend AI chips. Every row is checked before anything is written; read skipped_rows, failed_rows and warnings and report them.

Edit a product

fsapi GET /products/101                      # read first
fsapi PATCH /products/101 -d '{"meta_description":"New text"}'

Only the fields you send change. PATCH does not set categories (use step 4 above) or tags. Ratings: author_rating is 1 to 5 in steps of 0.1; author_verdict max 600 characters; author_pros and author_cons up to 8 items of 160 characters. Write the owner's own words; do not invent a rating or verdict.

Switch off or delete

Prefer switching off (PATCH {"enabled": false}) to deleting: it keeps the page's history and can be undone. DELETE /products/{id} soft-deletes and needs the user's yes. For a whole old niche, use Retire Catalogue in redirects.md, which switches everything off and redirects the old URLs.

Clean up the catalog

To remove expired offers, products with no offer, and empty brands and categories, use the site's own cleaner instead of deleting one by one:

fsapi GET /tools/offer-health     # counts only, changes nothing (store:read)

Show the counts. After a clear yes:

fsapi POST /store/clean -d '{"operations": ["expired_offers", "offerless_products"]}'

operations is any of expired_offers, out_of_stock_offers, offerless_products, empty_brands, empty_categories (default: all except out_of_stock_offers). Clean deletes. It needs a Full Access key, or the broad Write box with no per-resource boxes.

Images

fsapi POST /products/101/images -d '{"collection":"gallery","url":"https://example.com/photo.jpg"}'

Adds a gallery picture from a public JPEG, PNG, WebP or GIF URL (max 10 MB, redirects not followed). "replace": true clears the gallery first and needs the user's yes. The API does not take file uploads.

SKILL.md

tile.json