Developers · Agents
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.
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.
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
get_marketing_kitreadReady-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.
| slug | string | required |
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_productreadFull detail for one product by slug: description (marketing copy source), cover + gallery URLs, tags, price, sales, revenue, product URL. Read-only.
| slug | string | required |
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_statsreadSales 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_inforeadStore 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_ordersreadRecent orders with buyer email, product title, amount, status, and payment id. Read-only. Use for customer support and revenue checks.
| status | string | optional |
| limit | integer | optional |
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_productsreadList 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.
| active | boolean | optional |
| tag | string | optional |
| limit | integer | optional |
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}'delete_productwritePERMANENTLY 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.
| slug | string | required |
| confirm | boolean | required |
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_paidwriteManually 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_id | integer | required |
| stripe_payment_intent_id | string | required |
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_ebookwritePublish (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...
| slug | string | required |
| title | string | required |
| price | integer | required |
| description | string | optional |
| subtitle | string | optional |
| tags | array | optional |
| pdf_base64 | string | required |
| pdf_filename | string | required |
| cover_base64 | string | optional |
| cover_filename | string | optional |
| product_type | string | optional |
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_activewriteActivate 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.
| slug | string | required |
| active | boolean | required |
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_productwriteCreate 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).
| slug | string | required |
| title | string | optional |
| price | integer | optional |
| description | string | optional |
| tags | array | optional |
| file_path | string | optional |
| images | array | optional |
| active | boolean | optional |
| product_type | string | optional |
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.