Skip to content

Developers · Agents

Unloop Store (US) Agent API

One tool layer, three surfaces. Point an MCP client, a Custom GPT, or plain curl at this store — agents can browse the catalog with product URLs and covers, fetch ready-to-post marketing copy, check sales, publish ebooks, and recover missed payments.

Authentication

Every request needs a Bearer key. Mint one in the admin panel (shown once, stored hashed):

# 1. Mint a key at https://shop-store.unloop.my/admin/agents
# 2. Use it on every call
Authorization: Bearer unuk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Rate limits: 120 reads/min, 30 writes/min per key. Key prefixes differ per store — MY keys (unmk_) and US keys (unuk_) are not interchangeable.

Surfaces

MCP — Claude, opencode, ChatGPT connectors

Stateless Streamable HTTP, JSON-RPC 2.0 (initialize, tools/list, tools/call):

POST https://shop-api.unloop.my/api/mcp
{"jsonrpc":"2.0","id":1,"method":"tools/list"}

REST — curl, Hermes, integrations

Call any tool directly — the JSON body is the tool args:

POST https://shop-api.unloop.my/api/agent/{tool}

Self-discovery — zero docs feeding

Point an agent here and it learns every tool, schema, and example itself:

GET https://shop-api.unloop.my/api/agent

OpenAPI 3.1 — Custom GPT Actions import

Public schema (ChatGPT fetches it before applying auth config). In a GPT: Actions → Import from URL, then API Key auth type Bearer.

GET https://shop-api.unloop.my/api/agent/openapi.json

Read tools (6)

get_marketing_kitread

Ready-to-post marketing material for a product: synopsis, target audience, key benefits, ad headlines, ad primary text, and pre-written social copy for Threads and Instagram, plus CTA text and the product URL. THE tool for social media posting — fetch this before writing custom copy. Read-only.

slugstringrequired
curl -X POST https://shop-api.unloop.my/api/agent/get_marketing_kit \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"stop-caring"}'
get_productread

Full detail for one product by slug: description (marketing copy source), cover + gallery URLs, tags, price, sales, revenue, product URL. Read-only.

slugstringrequired
curl -X POST https://shop-api.unloop.my/api/agent/get_product \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"stop-caring"}'
get_sales_statsread

Sales summary: total paid orders + revenue, revenue for last 7 and 30 days, orders by status, and top 5 products by revenue — use to decide which products to promote. Read-only.

curl -X POST https://shop-api.unloop.my/api/agent/get_sales_stats \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
get_store_inforead

Store overview for Unloop Store (US): URLs, currency, catalog size, payment provider. Read-only. Use this first to learn the store's product URL pattern before composing social posts.

curl -X POST https://shop-api.unloop.my/api/agent/get_store_info \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
list_ordersread

Recent orders with buyer email, product title, amount, status, and payment id. Read-only. Use for customer support and revenue checks.

statusstringoptional
limitintegeroptional
curl -X POST https://shop-api.unloop.my/api/agent/list_orders \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"paid","limit":10}'
list_productsread

List catalog products with sales + revenue stats, product URL, and cover image URL — everything needed to pick products to promote on social media. Read-only. Filter by active state or tag.

activebooleanoptional
tagstringoptional
limitintegeroptional
curl -X POST https://shop-api.unloop.my/api/agent/list_products \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"active":true,"limit":20}'

Write tools (5)

delete_productwrite

PERMANENTLY deletes a product by slug from the catalog (irreversible). Requires confirm: true — calls without it are rejected with 400. Side effects: catalog write + Threads pipeline push.

slugstringrequired
confirmbooleanrequired
curl -X POST https://shop-api.unloop.my/api/agent/delete_product \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"old-ebook","confirm":true}'
mark_order_paidwrite

Manually mark an order as paid and trigger the buyer fulfilment email (recovery when a payment webhook was missed). Idempotent — already-paid orders return alreadyPaid. Side effects: order write + buyer email + Telegram notification.

order_idintegerrequired
stripe_payment_intent_idstringrequired
curl -X POST https://shop-api.unloop.my/api/agent/mark_order_paid \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"order_id":123,"stripe_payment_intent_id":"pay_xxx"}'
publish_ebookwrite

Publish (or republish) an ebook end-to-end: uploads the PDF/EPUB (base64) and optional cover image (base64) to storage, creates or updates the product by slug, and pushes to the Threads pipeline. Max sizes: ebook 25MB, cover 10MB (decoded). price is in whole USD. For a brand-new slug a frontend r...

slugstringrequired
titlestringrequired
priceintegerrequired
descriptionstringoptional
subtitlestringoptional
tagsarrayoptional
pdf_base64stringrequired
pdf_filenamestringrequired
cover_base64stringoptional
cover_filenamestringoptional
product_typestringoptional
curl -X POST https://shop-api.unloop.my/api/agent/publish_ebook \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"new-ebook","title":"New Ebook","price":390,"pdf_base64":"JVBERi0x...","pdf_filename":"new-ebook.pdf"}'
set_product_activewrite

Activate or deactivate a product by slug (deactivated products stay in the catalog but are hidden from the storefront). Side effects: catalog write + Threads pipeline push.

slugstringrequired
activebooleanrequired
curl -X POST https://shop-api.unloop.my/api/agent/set_product_active \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"stop-caring","active":false}'
upsert_productwrite

Create or update a product by slug (updates only the fields provided). Side effects: writes the catalog AND pushes the catalog to the Threads content pipeline. NOTE: brand-new slugs require a frontend rebuild before they appear on the storefront. price is in whole USD (no decimals).

slugstringrequired
titlestringoptional
priceintegeroptional
descriptionstringoptional
tagsarrayoptional
file_pathstringoptional
imagesarrayoptional
activebooleanoptional
product_typestringoptional
curl -X POST https://shop-api.unloop.my/api/agent/upsert_product \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"stop-caring","price":390,"tags":["mindset"]}'

Write tools mutate the catalog, push to the Threads pipeline, or send buyer emails. delete_product requires confirm: true — irreversible.