Skip to main content

Observations

A few important points about the ANYMARKET integration:

Limits​

Be nice. If you're sending too many requests quickly, we'll return an error code 429 (too many requests). You have a limit of:

image.png

Rate Limit Control Headers​

When making calls to the API, the following headers will be returned to inform about request limits:

  • ratelimit-reset: Indicates the remaining time (in seconds) for the request limit to be renewed and return to the maximum allowed by the endpoint.
  • ratelimit-limit: Defines the maximum number of requests the endpoint supports within the established period.
  • ratelimit-remaining: Shows the number of remaining requests that can be made in the current minute. This value decreases with each request made.

These headers help manage API usage efficiently and avoid exceeding the established limits.

Operations​

We do our best to make sure that all our URLs are RESTful. Each URL can support one of four different http verb types:

  • GET retrieves information about a resource
  • POST creates a resource
  • PUT updates a resource
  • DELETE deletes a resource

Structure​

Pagination​

The vast majority of requests that return a collection of resources are paginated. For example, the query for main categories. Every paginated response is returned in the following format:

{
"links": [
{
"rel": "prev",
"href": "https://sandbox-api.anymarket.com.br/v2/categories?offset=0"
},
{
"rel": "next",
"href": "https://sandbox-api.anymarket.com.br/v2/categories?offset=4"
}
],
"content": [
...
],
"page": {
"size": 2,
"totalElements": 6,
"totalPages": 3,
"number": 1
}
}

To facilitate the sequential navigation of data, we provide links to go to the next page or return to the previous one.

By default the query returns 20 resources per page. However, we allow this number to be increased up to a maximum of 100. Below are the parameters that change the way the page is returned:

  • offset: Indicates from which resource the query will start. For the query to start from the first page, the offset must be set to 0.
  • limit: Indicates the amount of resources to be returned, ranging from 20 to a maximum of 100.
  • sort: Indicates which attribute the query should be ordered by

Date​

Every attribute that receives a Date must be informed by passing the Time Zone.
If the partner controls the Time Zone, it must also control Daylight Saving Time, making the necessary adjustments.

Example:
08/03/2018 10:00:00 Time Zone GMT-3
Must be informed as follows 2018-03-08T10:00:00-03:00 Order Date validations:

  • The "CREATION DATE" (createdAt) of the order cannot be empty.
  • The "INVOICE ISSUE DATE" (date) Object[invoice] must be greater than or equal to the "CREATION DATE" (createdAt) of the order.
  • The "INVOICE ISSUE DATE" (date) Object[invoice] must be greater than the "PAYMENT DATE" (paymenteDate) of the order.
  • The "PAYMENT DATE" (paymenteDate) must be greater than the "CREATION DATE" (createdAt) of the order.
  • The "SHIPPING DATE" (date) Object[tracking] must be greater than or equal to the "INVOICE ISSUE DATE" (date) Object[invoice] of the order.
  • The "SHIPPING DATE" (date) Object[tracking] must be greater than the "CREATION DATE" (createdAt) of the order.
  • The "DELIVERY DATE" (deliveredDate) Object[tracking] must be greater than or equal to the "SHIPPING DATE" (date) Object[tracking] of the order.
  • The "ESTIMATED DELIVERY DATE" (estimateDate) Object[tracking] must be greater than or equal to the "SHIPPING DATE" (date) Object[tracking] of the order.