{
"openapi": "3.0.0",
"info": {
"title": "Pricing API",
"description": "\r\n> Check the new [Pricing onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/pricing-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Pricing and is organized by focusing on the developer's journey.\r\n\r\nPricing is the VTEX module responsible for the SKU's price list. At this module we have the base price of each SKU, some optional fixed prices by trade policy, and some rules that can be applied to generate dynamically different final prices according to the purchase context and the trade policy. The variables used in this collection are:\n\n`{{accountName}}` = You VTEX account name.\n\n`{{tradePolicyId}}` = Current Trade Policy ID.\n\n`{{itemId}}` = SKU ID.\n\n`{{X-VTEX-API-AppKey}}` and `{{X-VTEX-API-AppToken}}` = Credentials used in Authentication.\n\nYou can get more information about how to use this module and its business logic at our [Pricing onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/pricing-overview).\n\n## Rate Limits per route\nThe rate limits per route revolve around the following values:\n\n\n| Operation | Rate | Burst credits |\n|-----------|----------------------------------|----------------|\n| GET | No rate limits | No rate limits |\n| POST/PUT |- 2000 per minute
- 33 per second | 500 |\n| DELETE | - 1000 per minute
-16 per second | 300 |\n\n### What are Burst Credits?\nIn case the account exceeds the limit frequency for a Rate Limiter (for instance, when one account makes 41 requests/second in any price insert/update route), we decrease from the Burst Credit count the exceeding (in this example, 1 Credit).\n\nIn the event of the Burst Credits reaching 0 (zero), the request is blocked with a Status 429 response.\n\nThe credits fill up over time when the route is not being used, in the same rate as the route's Rate Limiter. In our example, for each second not sending a PUT or POST request, we increase 40 Burst Credits to this Rate Limiter\n\n### Response Headers for rate limits\nIn the response headers of any request to the Pricing API, there are some headers indicating the current status of the Rate Limiting. This information may be useful to evaluate the ideal frequency to send requests to a route, and when to send a new request in the event of reaching a Rate Limit.\n\n- `Ratelimit-Limit`: Total Burst Credits offered to a route\n- `Ratelimit-Remaining`: How many Burst Credits are still available to use\n- `Ratelimit-Reset`: How long (in seconds) it will take for Burst Credits to fill up completely (it will fill up to the *Ratelimit-Limit*)\n- `Retry-After`: Indicates how many seconds you will need to wait until the Rate Limiter accepts a new request to this route again. If this header response exists, this means your current request has been rate limited and has not been processed.\n\n\n### How to integrate with Pricing v2 considering our Rate Limits\nIntegrate considering the limits of requests/route/account specified in the [Rate Limits per route](#rate-limits-per-route) section, avoiding to surpass this frequency.\n\nIf you happen to be Rate Limited, please await the time in seconds specified in `Retry-After` before making another request to the service, and reduce the rate of requests per second that your integration is making.",
"contact": {},
"version": "1.0"
},
"servers": [
{
"url": "https://api.vtex.com/{accountName}",
"description": "VTEX server url",
"variables": {
"accountName": {
"description": "Name of the VTEX account. Used as part of the URL",
"default": "{accountName}"
}
}
}
],
"paths": {
"/pricing/prices/{itemId}": {
"get": {
"tags": [
"Prices and Fixed Prices"
],
"summary": "Get Price",
"description": "Retrieves price data given a specific SKU ID. Within the `fixedPrices` object, there might be a list of prices for specific Trade Policies and Minimium Quantities of the SKU. Fixed Prices may also be scheduled.\r\n\r\n ## Response body example\r\n\r\n```json\r\n{\r\n \"itemId\": \"1\",\r\n \"listPrice\": 50,\r\n \"costPrice\": 90,\r\n \"markup\": 30,\r\n \"basePrice\": 117,\r\n \"fixedPrices\": [\r\n {\r\n \"tradePolicyId\": \"1\",\r\n \"value\": 50.5,\r\n \"listPrice\": 50.5,\r\n \"minQuantity\": 2,\r\n \"dateRange\": {\r\n \"from\": \"2021-12-31T01:00:00Z\",\r\n \"to\": \"2022-12-31T01:00:00Z\"\r\n }\r\n },\r\n {\r\n \"tradePolicyId\": \"2\",\r\n \"value\": 30,\r\n \"listPrice\": 50,\r\n \"minQuantity\": 2\r\n }\r\n ]\r\n}\r\n```",
"operationId": "GetPrice",
"parameters": [
{
"name": "Content-Type",
"in": "header",
"description": "Describes the type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"default": "application/json"
}
},
{
"name": "Accept",
"in": "header",
"description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
{
"name": "itemId",
"in": "path",
"description": "SKU ID.",
"required": true,
"style": "simple",
"schema": {
"type": "integer",
"example": 1
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Getprice"
},
"example": {
"itemId": "1",
"listPrice": 50,
"costPrice": 90,
"markup": 30,
"basePrice": 117,
"fixedPrices": [
{
"tradePolicyId": "1",
"value": 50.5,
"listPrice": 50.5,
"minQuantity": 2,
"dateRange": {
"from": "2021-12-31T01:00:00Z",
"to": "2022-12-31T01:00:00Z"
}
},
{
"tradePolicyId": "2",
"value": 30,
"listPrice": 50,
"minQuantity": 2
}
]
}
}
}
}
},
"deprecated": false
},
"delete": {
"tags": [
"Prices and Fixed Prices"
],
"summary": "Delete Price",
"description": "Deletes the Base Price and all available Fixed Prices for an SKU in all trade policies.",
"operationId": "DeletePrice",
"parameters": [
{
"name": "Content-Type",
"in": "header",
"description": "Describes the type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"default": "application/json"
}
},
{
"name": "Accept",
"in": "header",
"description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"default": "application/json"
}
},
{
"name": "itemId",
"in": "path",
"description": "SKU ID.",
"required": true,
"style": "simple",
"schema": {
"type": "integer",
"example": 1
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"deprecated": false
},
"put": {
"tags": [
"Prices and Fixed Prices"
],
"summary": "Create or Update Base Price or Fixed Prices",
"description": "Creates or updates an SKU Base Price or Fixed Prices. The **base price** is the basic selling price of a product, it comprises the cost price and the markup wanted in the sale of the product. The **fixed price** is an optional price of the SKU for a specific trade policy with a specific minimum quantity to be activated.\r\n\r\n
You may optionally set a list price. Additionally, you may set either a cost price or a markup value. By defining either one of them, the other will be calculated to conform to the formula costPrice * (1 + markup) = basePrice.