From 01729e5bac60e0edae50cf87c70b079fa9e48f30 Mon Sep 17 00:00:00 2001 From: Geise Costa <136460310+geisecosta@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:47:59 -0300 Subject: [PATCH] EDU-11062 New endpoint (#1348) --- PostmanCollections/VTEX - Pricing API.json | 218 ++++++++++++++++----- VTEX - Pricing API.json | 70 +++++-- 2 files changed, 232 insertions(+), 56 deletions(-) diff --git a/PostmanCollections/VTEX - Pricing API.json b/PostmanCollections/VTEX - Pricing API.json index e874d0e24..738ef5f70 100644 --- a/PostmanCollections/VTEX - Pricing API.json +++ b/PostmanCollections/VTEX - Pricing API.json @@ -1,10 +1,10 @@ { "_": { - "postman_id": "0d48e5a5-50a6-4f6b-8168-22f78dec1e6d" + "postman_id": "bec2846c-cee3-47ec-84d5-07e02dc71de3" }, "item": [ { - "id": "57994901-af84-43f8-89b0-324bce16e349", + "id": "39442af1-72fd-4795-a088-0733a978e468", "name": "Price Tables", "description": { "content": "", @@ -12,7 +12,7 @@ }, "item": [ { - "id": "94a9cc19-30b7-48f7-8126-f0df01e0e402", + "id": "9dd2cfbb-0388-4647-95d6-4d0f2d65d36e", "name": "Get rules for a price table", "request": { "name": "Get rules for a price table", @@ -86,7 +86,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "54f8ca61-2536-46a9-b5c9-4d3a260fd439", + "id": "4d5fe92c-02a3-4722-8c7a-fd837427e8e5", "name": "OK", "originalRequest": { "url": { @@ -157,7 +157,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "705de5bb-f70e-49f9-89ab-d8cda0c6c079", + "id": "b10a77c2-b355-496b-b0f1-fab9b5689d71", "name": "Unauthorized", "originalRequest": { "url": { @@ -218,7 +218,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "a23498da-6e58-46f3-891f-2e909c1318b3", + "id": "b7ca8e3a-3ce2-4f86-9a02-c92fa813aea1", "name": "Forbidden", "originalRequest": { "url": { @@ -279,7 +279,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "2455f85b-20c3-4bfa-a27d-fbdee0fba475", + "id": "483b8ee9-dc78-447c-81bd-3e34fcf2db7b", "name": "Too many requests", "originalRequest": { "url": { @@ -343,7 +343,7 @@ } }, { - "id": "3ec816c2-2ada-47cb-9566-d3873bd6627e", + "id": "0edb421d-9391-4ded-9ab6-491b28dad05e", "name": "Update rules for a price table", "request": { "name": "Update rules for a price table", @@ -370,7 +370,7 @@ "type": "text/plain" }, "type": "any", - "value": "ut", + "value": "dolore cupidatat aute ea", "key": "priceTableId" } ] @@ -416,7 +416,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "4882064d-ff64-4a06-8d1f-cb179a230029", + "id": "b8a6eba4-ff84-459b-b5e6-8f87dff3191c", "name": "Created", "originalRequest": { "url": { @@ -486,7 +486,7 @@ { "listen": "test", "script": { - "id": "b6b36a19-eb0c-484e-a07d-aaa0da60fc3d", + "id": "bdd68cd1-5f14-41b1-b9e0-e635f7001ad6", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[PUT]::/pricing/pipeline/catalog/:priceTableId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n" @@ -499,7 +499,135 @@ } }, { - "id": "76df6424-45ed-401b-aba4-83933ac1f5d6", + "id": "d4532ab0-732b-4c3a-820f-f1063acb762d", + "name": "Create price table", + "request": { + "name": "Create price table", + "description": { + "content": "Create a new price table.\r\n\r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Pricing | Price List | **Modify prices** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "type": "text/plain" + }, + "url": { + "path": [ + "pricing", + "tables", + ":priceTableId" + ], + "host": [ + "{{baseUrl}}" + ], + "query": [], + "variable": [ + { + "disabled": false, + "description": { + "content": "(Required) Price Table Name.", + "type": "text/plain" + }, + "type": "any", + "value": "dolore cupidatat aute ea", + "key": "priceTableId" + } + ] + }, + "header": [ + { + "disabled": false, + "description": { + "content": "(Required) Describes the type of the content being sent.", + "type": "text/plain" + }, + "key": "Content-Type", + "value": "application/json" + }, + { + "disabled": false, + "description": { + "content": "(Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", + "type": "text/plain" + }, + "key": "Accept", + "value": "application/json" + } + ], + "method": "PUT", + "body": {} + }, + "response": [ + { + "_": { + "postman_previewlanguage": "text" + }, + "id": "3fe45c0d-aedf-41cd-b2e7-62bdaa47683d", + "name": "OK", + "originalRequest": { + "url": { + "path": [ + "pricing", + "tables", + ":priceTableId" + ], + "host": [ + "{{baseUrl}}" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "disabled": false, + "description": { + "content": "(Required) Describes the type of the content being sent.", + "type": "text/plain" + }, + "key": "Content-Type", + "value": "application/json" + }, + { + "disabled": false, + "description": { + "content": "(Required) HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", + "type": "text/plain" + }, + "key": "Accept", + "value": "application/json" + }, + { + "description": { + "content": "Added as a part of security scheme: apikey", + "type": "text/plain" + }, + "key": "X-VTEX-API-AppKey", + "value": "" + } + ], + "method": "PUT", + "body": {} + }, + "status": "OK", + "code": 200, + "header": [], + "cookie": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "id": "c0580988-8f68-49ee-8491-0175fc4a3500", + "type": "text/javascript", + "exec": [ + "// Validate status 2xx \npm.test(\"[PUT]::/pricing/tables/:priceTableId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n" + ] + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + } + }, + { + "id": "72d99832-485b-40b9-9a9f-26d4477013ba", "name": "Get all price tables and their rules", "request": { "name": "Get all price tables and their rules", @@ -562,7 +690,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "ac060469-0c2f-4ad1-b4aa-88e5bcf64608", + "id": "17ae6908-8e15-4a4a-b4be-b951299db75f", "name": "OK", "originalRequest": { "url": { @@ -635,7 +763,7 @@ } }, { - "id": "16fc331d-eaad-41ff-aa79-26cbacda93ac", + "id": "b13ae268-9b53-4cec-9d3e-4480fc8205e3", "name": "List price tables", "request": { "name": "List price tables", @@ -697,7 +825,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "1da7817d-c5b0-46ad-8231-0eaa7270908e", + "id": "2069f7d1-f41b-41f4-95fa-cdb4cec239f6", "name": "OK", "originalRequest": { "url": { @@ -772,7 +900,7 @@ "event": [] }, { - "id": "713dcd44-2249-4d82-8d47-957f9131c7a0", + "id": "1380ccd1-37a4-4a10-8bac-233d6b38533a", "name": "Prices and Fixed Prices", "description": { "content": "", @@ -780,7 +908,7 @@ }, "item": [ { - "id": "dbc7b62d-e472-49fd-852b-770bf27c2cbd", + "id": "855205ac-c279-4699-ab02-640a5882551f", "name": "Get price by SKU ID", "request": { "name": "Get price by SKU ID", @@ -843,7 +971,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "e836d4fb-3fb6-4cf0-8480-47d05911220b", + "id": "20793cac-aa7e-4ce7-8dca-e9f7bd98458f", "name": "OK", "originalRequest": { "url": { @@ -909,7 +1037,7 @@ { "listen": "test", "script": { - "id": "f7ccb9e2-b37f-4417-84a8-91a37429ceaa", + "id": "7f47f1a8-b06d-427f-80ed-1a709fb073db", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[GET]::/pricing/prices/:itemId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", @@ -925,7 +1053,7 @@ } }, { - "id": "1285b09e-ac84-4947-8903-17e9d326e72b", + "id": "455d1045-fb8d-403a-a5d3-70e5478b764d", "name": "Delete price all base and fixed prices of an SKU", "request": { "name": "Delete price all base and fixed prices of an SKU", @@ -984,7 +1112,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "b9a82ec7-b0b4-4067-b5e4-c7f04bab5d49", + "id": "73d23757-fbcd-4586-9f3a-aa9240c83f20", "name": "OK", "originalRequest": { "url": { @@ -1040,7 +1168,7 @@ { "listen": "test", "script": { - "id": "e07c92e7-8c8c-474d-b22c-44f4aacd0316", + "id": "ff4442a4-1eb5-42e3-b4b3-f547e0c74ab2", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[DELETE]::/pricing/prices/:itemId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n" @@ -1053,7 +1181,7 @@ } }, { - "id": "3771b7e6-439d-470a-a7c3-88e85f1daf08", + "id": "9127dbee-0e42-4468-a38e-d79f2ad13c02", "name": "Create or update base price or fixed prices", "request": { "name": "Create or update base price or fixed prices", @@ -1125,7 +1253,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "84dec8fe-453d-4234-833c-4ebd54a50a9e", + "id": "20f2a618-3612-4c56-a570-cb14bb4cc6cd", "name": "OK", "originalRequest": { "url": { @@ -1194,7 +1322,7 @@ { "listen": "test", "script": { - "id": "f577780d-a336-4b82-b59e-af13516d7a07", + "id": "a3102b7a-c9a0-4aa1-9c2c-4ae1d100e927", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[PUT]::/pricing/prices/:itemId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n" @@ -1207,7 +1335,7 @@ } }, { - "id": "fe3793ab-f794-4ec1-ae83-e99644150909", + "id": "69d0f41a-0c27-4a45-b3bd-1e80c96158da", "name": "Get fixed prices", "request": { "name": "Get fixed prices", @@ -1271,7 +1399,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "50e5e3bd-39a9-4d3f-ac0e-9d28036a3bf3", + "id": "792d8240-bab5-4c6d-b566-fdf5e7787f32", "name": "OK", "originalRequest": { "url": { @@ -1338,7 +1466,7 @@ { "listen": "test", "script": { - "id": "a52792c0-b87c-4c91-86b9-d94289c42d94", + "id": "9abd875d-81ff-469a-90bd-91007551ade3", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[GET]::/pricing/prices/:itemId/fixed - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", @@ -1354,7 +1482,7 @@ } }, { - "id": "8c185d15-d095-41c7-8668-659be5e9cef2", + "id": "af6234aa-8bb6-492a-a311-f1d3a4fa8850", "name": "Create or update fixed prices on a price table or trade policy", "request": { "name": "Create or update fixed prices on a price table or trade policy", @@ -1438,7 +1566,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "50f70ffb-406c-4585-9f84-c281aaaf6a7a", + "id": "a6248e26-247f-42b2-bac0-4d8b9f7aa7ed", "name": "OK", "originalRequest": { "url": { @@ -1509,7 +1637,7 @@ { "listen": "test", "script": { - "id": "b73c8c40-c368-456a-a2d0-326565c3f9ab", + "id": "82a1d6f1-aa24-4b9a-9df1-904b125d56f7", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[POST]::/pricing/prices/:itemId/fixed/:priceTableId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n" @@ -1522,7 +1650,7 @@ } }, { - "id": "8b45c633-0375-4e58-9033-539099353f31", + "id": "cdcb3b23-289b-41e9-a655-e9353a1b9eba", "name": "Get fixed prices on a price table or trade policy", "request": { "name": "Get fixed prices on a price table or trade policy", @@ -1597,7 +1725,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "6406e2af-579d-4fda-b495-4cad6f2ae187", + "id": "49f190ef-14dd-4aa1-b964-d0ca265802f1", "name": "OK", "originalRequest": { "url": { @@ -1665,7 +1793,7 @@ { "listen": "test", "script": { - "id": "f0e0afd2-54d2-44c5-85a4-e4142544706c", + "id": "1a89de28-bd06-4e25-bb14-2d0051dc50eb", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[GET]::/pricing/prices/:itemId/fixed/:priceTableId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n", @@ -1681,7 +1809,7 @@ } }, { - "id": "c9882aa6-d8e7-4538-a33d-2aefbeb127f8", + "id": "05e83b88-b398-4df1-915e-e8cecc096ce2", "name": "Delete fixed prices on a price table or trade policy", "request": { "name": "Delete fixed prices on a price table or trade policy", @@ -1752,7 +1880,7 @@ "_": { "postman_previewlanguage": "text" }, - "id": "c75ac537-ee2e-4531-a3c7-482928cf9ea4", + "id": "a2bc7e19-2e3a-433e-8e34-3a4e1a9b613f", "name": "OK", "originalRequest": { "url": { @@ -1810,7 +1938,7 @@ { "listen": "test", "script": { - "id": "49108817-f51b-4c7c-9791-45cbc78a169c", + "id": "808dc12e-9850-4c29-a753-b39e60e36766", "type": "text/javascript", "exec": [ "// Validate status 2xx \npm.test(\"[DELETE]::/pricing/prices/:itemId/fixed/:priceTableId - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n" @@ -1823,7 +1951,7 @@ } }, { - "id": "e56dc5c9-ade8-43d1-94ab-daf8ff48dfb1", + "id": "3ec02ee4-1f46-4a97-8fe5-5097b526e84e", "name": "Get computed price by price table or trade policy", "request": { "name": "Get computed price by price table or trade policy", @@ -1936,7 +2064,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "8acb1f56-ec2a-44cf-a571-e637d58fdeea", + "id": "6d69d019-c460-4aec-9dd5-91c376a68236", "name": "OK", "originalRequest": { "url": { @@ -2042,7 +2170,7 @@ "event": [] }, { - "id": "1e1f93cf-ee2a-4824-963b-871099ff3b7c", + "id": "a88aa963-07f9-48ff-af02-ec3e2faf336c", "name": "Pricing Configuration", "description": { "content": "", @@ -2050,7 +2178,7 @@ }, "item": [ { - "id": "bf61ecf6-6580-4358-a5a0-e06ac5f802b2", + "id": "f40d2c80-e872-450d-90e7-be3b5457ba88", "name": "Get pricing configuration", "request": { "name": "Get pricing configuration", @@ -2112,7 +2240,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "f7948206-c897-4ead-a80f-c5446f891f34", + "id": "40aec1d8-fbe9-4452-a046-50e104d041d2", "name": "OK", "originalRequest": { "url": { @@ -2283,7 +2411,7 @@ } }, { - "id": "a69af407-f351-4753-80e5-fd500160641e", + "id": "79495d4c-53fb-4623-aee5-b68ada8e89b7", "name": "Get pricing v2 status", "request": { "name": "Get pricing v2 status", @@ -2345,7 +2473,7 @@ "_": { "postman_previewlanguage": "json" }, - "id": "c725e3c1-5ffd-4110-b8f6-c75521debd92", + "id": "a3c2225c-9cec-40b9-b0e0-fcf3f583362e", "name": "OK", "originalRequest": { "url": { @@ -2553,7 +2681,7 @@ } ], "info": { - "_postman_id": "0d48e5a5-50a6-4f6b-8168-22f78dec1e6d", + "_postman_id": "bec2846c-cee3-47ec-84d5-07e02dc71de3", "name": "Pricing API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "description": { diff --git a/VTEX - Pricing API.json b/VTEX - Pricing API.json index 5192f25db..05ab9c912 100644 --- a/VTEX - Pricing API.json +++ b/VTEX - Pricing API.json @@ -318,22 +318,22 @@ } } }, - "example" : { + "example": { "markup": 30, "listPrice": 50.00, "basePrice": 100.00, "costPrice": 35.00, "fixedPrices": [ - { - "tradePolicyId": "1", - "value": 50.50, - "listPrice": 50.50, - "minQuantity": 2, - "dateRange": { - "from": "2021-12-30T22:00:00-03:00", - "to": "2021-12-30T22:00:00-03:00" + { + "tradePolicyId": "1", + "value": 50.50, + "listPrice": 50.50, + "minQuantity": 2, + "dateRange": { + "from": "2021-12-30T22:00:00-03:00", + "to": "2021-12-30T22:00:00-03:00" + } } - } ] } } @@ -1584,6 +1584,54 @@ } } }, + "/pricing/tables/{priceTableId}": { + "put": { + "tags": [ + "Price Tables" + ], + "summary": "Create price table", + "description": "Create a new price table.\r\n\r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Pricing | Price List | **Modify prices** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "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": "priceTableId", + "in": "path", + "description": "Price Table Name.", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, "/pricing/pipeline/catalog": { "get": { "tags": [ @@ -2101,7 +2149,7 @@ "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppKey", - "description":"Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)." + "description": "Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)." }, "appToken": { "type": "apiKey",