Skip to main content

Price API Integration

ANYMARKET allows the seller to provide their own price query implementation. When this implementation is enabled, ANYMARKET will start performing requests to the given URL. When creating a new offer, it will use the prices returned from this request for the "Price From" (price) and "Price To" (discountPrice) fields.

The image below shows how the price query flow is performed, from the beginning of the creation of the offer to its conclusion.

To enable the API price query, the seller must access the ANYMARKET parameters page, select the option Use price calculation by API and inform the API URL as shown in the following image.

warning

Warning!โ€‹

The request will only be performed for products with price scope calculation "Manual, I control the price by the offer"

Using the Price API Integrationโ€‹

When the integration is enabled, ANYMARKET will make a POST request to the endpoint informed in the system parameters, sending the following as a parameter (Query String):

ParameterDescription
tokenAuthentication TOKEN of the account performing the request. Used to identify which ANYMARKET account is requesting the service.
oiInternal seller identification code in ANYMARKET.
SKUThe id of the SKU for which the offer is being created.
MarketplaceWhich MARKETPLACE is the offer being created on.

And as a request 'body', we will forward information we have about the offer being created:

Some of that informations are:

  • Product Title
  • Default Discount Type
  • Default Discount Value
  • If the offer has a discount enabled.
{
"fields": [{
"key": "string",
"value": "string"
}]
}

As expected response:

{
"price": 123.45,
"discount": 123.45
}

Validations that will be performed on the request return:โ€‹

Fill in both values: the 2 fields are mandatory to return.

Invalid prices: Price From (price) price must be greater than the Price To (discountPrice).