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

feeds.mdreferences/

Product feeds

Connect an affiliate network product feed (or a CSV) and its products arrive in the site's categories, each with a custom offer on the network's tracking link. Scope: products:read to read, products:write for the rest, plus categories:read for the category map.

How a run behaves:

  • A new row that passes the filters becomes a product with one offer.
  • A row the feed already made updates that offer's price, stock and link. The owner's own product copy is never touched.
  • A product missing from the feed on two complete runs in a row is retired (not deleted), and comes back if the row returns. A short or partial run retires nothing.
  • Feeds refresh daily (default), weekly, or only on demand (manual).

Networks

networkcredentials (secret)source
awinfeed_key (the product feed API key from a Create-a-Feed link)feed_ids, and publisher_id for Enhanced feeds
impactaccount_sid, auth_tokencatalog_ids, tracking_link
cjaccess_tokencompany_id, pid, and ad_ids or advertiser_ids
rakutenclient_id, client_secretsid, mids, optional keyword
tradedoublertoken (products token)feed_ids
avantlinknoneaffiliate_id, website_id, merchant_ids or datafeed_ids
csvnonecsv_url, or a multipart file

Credentials are network secrets. Ask the user to put them in environment variables, pass them straight into the request, and never print them. Responses never return them, only credentials_set.

1. Look at what is there

fsapi GET /feeds
fsapi GET /categories/tree

2. Create the feed (imports nothing yet)

Agree the category map and filters with the user first.

fsapi POST /feeds -d '{
  "network": "awin",
  "name": "Hand tools feed",
  "credentials": {"feed_key": "'"$AWIN_FEED_KEY"'"},
  "source": {"feed_ids": "5001"},
  "category_map": [{"match": "pliers", "category_id": 12}, {"match": "*", "category_id": 10}],
  "filters": {"min_price": 5, "in_stock_only": true, "max_products": 100},
  "schedule": "daily",
  "generate_content": false
}'

category_map: the first rule whose match words appear in the row's feed category wins; * matches every row. default_category_id catches rows no rule matches. filters.max_products is 1 to 2,000 (default 100). filters.include and filters.exclude take words. Keep generate_content false unless the user agrees to spend AI chips on every new product.

3. Preview (writes nothing)

fsapi POST /feeds/{id}/preview

Returns the connection message and the first 20 rows as they would import, with the site category each lands in and action (create or update). Show the user the rows, the kept and left_out counts and, if content is on, the content_chips estimate. Fix the map or filters with PATCH /feeds/{id} and preview again.

4. Run it

fsapi POST /feeds/{id}/import      # 202, queued
fsapi GET /feeds/{id}              # read last_status, last_message, last_counts

last_status is queued, running, done, partial or failed. 409 means a run is already going. Poll every minute or so, not faster.

Change or remove

  • PATCH /feeds/{id} changes any field except network. A credential key you leave out keeps its value; "" clears it.
  • DELETE /feeds/{id} disconnects the feed. Its products and offers stay on the site and stop refreshing. Confirm first.

SKILL.md

tile.json