ANYMARKET Backoffice API Guide
Skill that teaches the AI assistant how to integrate correctly with the ANYMARKET v2 Backoffice API. It covers authentication, environments, the 17 API domains (products, SKUs, orders, stock, prices, listings, NF-e, callbacks, campaigns, monitoring, users, roles and more), the domain dependency graph, error pattern, pagination, rate limit and the greenfield vs brownfield flow.
Target audience: developers integrating an ERP (TOTVS, Winthor, Protheus, SAP, custom ERP) with ANYMARKET. This is not an end-user skill β the focus is correct integration code on the first attempt.
What it solvesβ
API integrations have two classic pitfalls:
- Writing a request "from memory" β wrong field name, missing
required field, wrong HTTP verb for a status transition. Costs a
400/422on the spot. - Ignoring project context β introducing a second HTTP client, a second retry strategy or a second log format into a codebase that already has all of that. Costs a failed code review.
The skill guards against both: it forces a Spec API lookup before generating code and distinguishes greenfield (new project) from brownfield (existing project) in the very first message.
How to invokeβ
Two ways:
- Command: type
/anymarket-backoffice-api-guidein your harness (the AI client/IDE you use) β the exact command format may vary from harness to harness. - Natural language: any request related to ERP β ANYMARKET
integration triggers the skill. Examples:
- "I need to integrate product registration with ANYMARKET via TOTVS."
- "How do I implement order polling using
/orders/feeds?" - "What do I have to send to publish a SKU on Mercado Livre?"
- "Which fields are required in
POST /products?" - "NF-e issuance through the ANYMARKET API."
What the skill will ask before actingβ
The skill won't fire the first call or generate code without confirming three points β by design, to prevent rework:
- Environment β Sandbox
(
sandbox-api.anymarket.com.br/v2) or Production (api.anymarket.com.br/v2)? A sandbox token returns401on production and vice-versa. - Authentication β Is the
gumgaTokenfor the chosen environment available? Which value goes in theplatformheader (TOTVS,WINTHOR,ERP_PROPRIO, etc.)? Without both headers =401on every request. - Project context (Greenfield vs Brownfield) β New project or integration into an existing codebase? If brownfield, it opens a checklist to discover what to reuse (HTTP client, config, retry, logging etc.) before writing a single line of code.
Answering all three at once saves several round trips.
Golden rule β spec before codeβ
The skill carries business rules and routing, not the field contract of each endpoint. For any new request, the order is:
- Open the domain sub-reference (map below).
- Look up the contract in the Spec API before coding:
GET https://developers.anymarket.com.br/specs/backoffice/pt-BR/operations/<operationId>.jsonβ readrequestBody.application/json.schema(especially therequiredarray) and use theexamplesas a base payload. - Write the code from the resolved schema.
- Call the API only to test β never to discover the contract by trial and error.
Real cases the skill prevents:
- The product name is
title, notname. priceFactormust be> 0even when pricing is per SKU.- Order status transitions are
PUTwith paths (/faturado,/enviado,/concluido,/cancelado), notPOST. - Pagination
limitis 5β100; totals live inpage.totalPages/page.number. - Headers
gumgaTokenandplatformare mandatory on every call.
Covered domains (17)β
The skill maps each domain to a sub-reference (overview.md in each
folder), which the assistant opens on demand:
Catalog (product prerequisites)β
| Domain | Covers |
|---|---|
| brands | CRUD of brands |
| categories | CRUD of categories |
| variations | Variation types and values (for variable products) |
Product and SKUβ
| Domain | Covers |
|---|---|
| products | Simple product, variable product, read, update |
| skus | Add variant, update EAN/title/price, deactivate SKU |
| images | Upload, processing status, image removal |
Post-catalogβ
| Domain | Covers |
|---|---|
| stock | Stock, locations (MultiCDs), reservations |
| listings | Marketplace listings, transmissions, feeds |
| prices | Prices per marketplace, in bulk |
Orders and after-salesβ
| Domain | Covers |
|---|---|
| orders | Read/create/update orders, status transitions, feeds |
| returns | Returns |
| fiscal-documents | NF-e submission, reading fiscal documents |
Configuration and supportβ
| Domain | Covers |
|---|---|
| callbacks | Notification webhooks |
| campaigns | Discount campaigns |
| monitoring | Integration errors |
| users | Users |
| roles | Access profiles (permissions) |
Cross-cutting referencesβ
| Topic | Where |
|---|---|
| Pagination, filters, sorting | references/pagination.md |
| Rate limit, throttling, retry | references/rate-limit.md |
| HTTP errors (400, 401, 404, 422, 429) | references/errors.md |
| Glossary (API terms and acronyms) | references/glossary.md |
Dependency graph β catalogβ
The ANYMARKET API enforces a registration order. Creating a product
without its prerequisites returns 422. The skill follows this graph:
brands βββ
categories βββΌβββΆ products βββΆ skus βββΆ listings
variations βββ β β β
(variable products) ββββΆ images β βΌ
ββββΆ stock
ββββΆ prices
Recommended integration order:
- Brands
- Categories
- Variations (if variable product)
- Products
- Additional SKUs (post-creation, if needed)
- Images
- Stock
- Listings (publishing to marketplaces)
Feed pattern (polling)β
Several domains expose feeds to detect changes without depending on a webhook. The pattern is always the same:
1. GET /{domain}/feeds β array of unread {id, token}
2. Process each item
3. PUT /{domain}/feeds/batch β mark them all as read at once
OR
PUT /{domain}/feeds/{id} β mark individually
4. Repeat
Items not marked as read remain available for 30 days.
Feeds covered:
/orders/feedsβ new orders and changes/transmissions/feedsβ listing changes/transmissions-price/feedsβ price changes/reservations/feedsβ stock reservations
Installing the skillβ
- Clone the internal
anymarket-backoffice-api-guiderepository. - Copy the folder into the skills directory your harness reads (the default path varies per harness β check the official docs).
- Reload the harness (restart, reload command, or equivalent).
- Confirm the skill shows up in your harness's list of available skills
(
/help, settings panel, etc., depending on the case).
Best practices when using itβ
- Answer the three initial questions in one go. Environment, authentication and greenfield/brownfield β it saves several round trips.
- Let the skill open the sub-reference. Don't say "bring me the contract of POST /products" β let the assistant identify the domain and open the right reference. The field contract comes from the Spec API.
- Test in sandbox before production. The skill reminds you, but
worth reinforcing: a sandbox
gumgaTokenreturns401on production and vice-versa. - In brownfield, offer the repository for inspection. If you can't
tell which HTTP client / retry / logging the project uses, ask the
skill to read
pom.xml/package.json/pyproject.tomlbefore generating code.
Referencesβ
- Spec API (official contract): https://developers.anymarket.com.br/specs
- Developer docs: https://developers.anymarket.com.br/
- Internal skill repository:
anymarket-backoffice-api-guide(withSKILL.md+references/folder per domain).