API for Marketplaces | ANYMARKET
Welcome to the ANYMARKET API documentation for Marketplaces.
This documentation aims to guide the rules and expected behaviors in the construction of the middleware responsible for the integration of information between ANYMARKET and MARKETPLACE.

The person responsible for the integration must build a Middleware application following the endpoint standards established in the topic of “remotes”. These remotes will be the paths that ANYMARKET will send notifications or queries to complete the actions that the seller performs.
{{URL_MIDDLEWARE}}\sendproduct
{{URL_MIDDLEWARE}}\brands
After receiving the notifications and queries that ANYMARKET will forward to the middleware, it will need to interpret the calls and perform the appropriate actions to complete the Seller's requests, which may be internal processing of the marketplace itself or calls to the ANYMARKET API in order to enter information, update or consume data pertinent to the action being performed.
The Middleware application will be divided into two stages of operations that we will name:
REMOTES
The remotes will be the "paths" your API should contain. The ANYMARKET API will work as a notification system where we already have the remotes ready that will be triggered in the base URL of the API that you informed us when filling out the release document.
ANYMARKET API
ANYMARKET set of APIs that allow the middleware to insert information, update or consume data relevant to the action being performed.
In the image below we have the information that will be transferred through the middleware in a macro form:

In the "Middleware Remotes" topic of our documentation, there is more information about each notification or query that ANYMARKET performs in the middleware, which action the seller is requesting and the expected behaviors for each action, in order to guarantee the best experience for the Seller.
Integration steps
| # | Step | Responsible | Description |
|---|---|---|---|
| 1 | Completing the "New Marketplace Release Form" | Marketplace | This form contains information such as the Middleware URL, fields required for authentication in the marketplace (login/password or token), description, behaviors) |
| 2 | Release the Sandbox Environment | ANYMARKET | In this step ANYMARKET will create the new channel based on the information in the form from the previous step and provide: User access to ANYMARKET for you to carry out tests during development. And also your "appId" which will be the identifier of your marketplace within ANYMARKET, this id must be used in all calls you make to our API. |
| 3 | Building the Middleware | Marketplace | Step of building the middleware by the marketplace. |
| 4 | Approval | ANYMARKET | At this stage, our quality team will test the new marketplace to ensure that the integration complies with the expected acceptance criteria. More information about this process can be accessed in the topic "Approval Process" of our documentation. |
| 5 | Marketplace release in Beta | ANYMARKET | In this step we follow the first 5 sellers, aiming to ensure that everything is working correctly in the production environment. |
| 6 | Marketplace release in Production | ANYMARKET | We make the new marketplace available to all ANYMARKET Sellers. |
How the integration works
To facilitate the understanding of how Middleware should work, below is a list of the Remotes that the middleware needs to make available and their objectives, the ANYMARKET APIs available for the middleware to complete the actions of the processes, in addition to the flow design of how the middleware communicates with ANYMARKET and Marketplace:
Remotes
| POST | /testIntegration | mandatory | In this notification we send the authentication data in the marketplace configured by the Seller, so that the middleware validates the access. |
| POST | /saveAccount | mandatory | In this notification we send the configuration data informed by the Seller if the middleware wants to store it. |
| GET | /product/{{partnerId}} | mandatory | This query is used to obtain the advertisements from the marketplace, to link with the ANYMARKET broadcasts. |
| GET | /brands | optional | This query is used to obtain the brands from the marketplace and link them to the ANYMARKET brands. |
| GET | /categories | optional | This query is used to obtain the marketplace categories and link them to the ANYMARKET categories. |
| GET | /categories/{{id}} | optional | This query is used to obtain the child categories of the marketplace and link them to the ANYMARKET categories. |
| GET | /categories/attributes/{{id}} | optional | This query is used to obtain the attributes of the marketplace and link to ANYMARKET products. |
| GET | /variations/types | optional | This query is used to get the marketplace variations and link with the ANYMARKET variations. |
| POST | /canActive | optional | In this notification we send a preview of the product/sku data so that the middleware can validate if it can be published on the marketplace. (Action triggered when the seller accesses the "New Publication" functionality) |
| GET | /getDefaultSkuFields | optional | This query is used for the marketplace to inform additional fields for the seller to fill in when including a "New Publication" |
| POST | /canSave | mandatory | In this notification, we send a preview of the ad data so that the middleware can validate if it can be published in the marketplace. (Action triggered when the seller writes a "New Post"). |
| POST | /sendProduct | mandatory | In this notification we send all changes made to an ad: New Post, Ad registration changes, Inventory changes, Price changes, Pause an ad, End an ad and Resend an ad. |
| DELETE | /deletePublication | mandatory | This notification will be triggered when a broadcast is deleted from the ANYMARKET dashboard, in order for the marketplace to inactivate the ad. |
| POST | /order/force/{{id}} | mandatory | We will send this notification whenever the seller requests the resending of the order from the marketplace to ANYMARKET (Monitoring) |
| POST | /forceImportOrders | mandatory | We will send this notification when the seller requests to import all orders to the ANYMARKET panel (Configuration Screen). |
| GET | /order/{{id}} | mandatory | This query is used to consult information about the marketplace order. |
| PUT | /updateOrderStatusInMarketplace | required | This notification is sent whenever there is an order change in ANYMARKET, so that the middleware sees the updated order information and replicates to the marketplace. |
ANYMARKET APIs
| GET | /api/configuration | optional | Consults all the settings made by the seller on ANYMARKET. |
| GET | /api/configuration/{id} | optional | Query by account ID the settings made by the seller on ANYMARKET. |
| GET | /skumarketplace/{id} | mandatory | Consult the ad data on ANYMARKET. |
| PUT | /skumarketplace/{id} | mandatory | Used to have the middleware mark the ad as up to date. |
| POST | /orders | mandatory | Used for the middleware to write the request to ANYMARKET. |
| PUT | /orders/{id}/markAsPaid | mandatory | Used for the middleware to mark the order as PAID in ANYMARKET. |
| PUT | /orders/{id}/markAsCanceled | mandatory | Used for the middleware to mark the order as CANCELLED in ANYMARKET. |
| PUT | /orders/{id}/markAsShipped | optional | Used for the middleware to mark the request as SENT in ANYMARKET. |
| PUT | /orders/{id}/markAsDelivered | optional | Used for the middleware to mark the order as DELIVERED in ANYMARKET. |
| GET | /orders/{id} | mandatory | Allows the middlewar to query the order data in ANYMARKET. |
| PUT | /orders/{id}/transmissionStatus | mandatory | Used for the middleware to mark the request as up to date. |
Flow
| Caption | |
|---|---|
| ORANGE | Actions carried out by the Seller on the ANYMARKET panel |
| GREEN | Remotes that will be notified or consulted in MIDDLEWARE |
| YELLOW | ANYMARKET APIs that will be used in the processes |
| BLUE | Processing that ANYMARKET/MIDDLEWARE must perform after notifications |

Environments
Sandbox: http://sandbox-api.anymarket.com.br/marketplace/api
Production: https://api.anymarket.com.br/marketplace/api
Useful information
Operations
We do our best to make all our URLs RESTful. Each URL can support one of four different types of HTTP verbs:
| GET | get information about a resource |
| POST | create a resource |
| PUT | updates a resource |
| DELETE | delete a resource |
Consumption limits
Be nice. If you are sending too many requests quickly, we will return an error code 429 (too many requests).
You have a limit of 10 requests per second per token